注: linux 系统 --> CentOS 7 、JDK1.8 、Tomcat 7
首先说明下 dubbo-admin-2.5.4.war 在 JDK 1.8 的版本下 会报 下面这个错,在 JDK 1.7 可以正常使用, dubbo-admin.war 下载 地址 见文末
ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uriBrokerService': Cannot create inner bean '(inner bean)' of type [com.alibaba.citrus.service.uribroker.impl.URIBrokerServiceImpl$URIBrokerInfo] while setting bean property 'brokers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#25': Cannot create inner bean 'server' of type [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]: Bean property 'URIType' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
这里说一下 dubbo-admin.war 文件的打包
1、dubbo-admin下载地址 https://github.com/slightlee/dubbox
2、idea 导入项目 地址 :https://github.com/slightlee/dubbox.git
3、修改dubbo-admin工程下的pom.xml文件:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.5.3</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.citrus</groupId>
<artifactId>citrus-webx-all</artifactId>
<version>3.1.6</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
4、在dubbo-admin工程下打war包
mvn package -Dmaven.test.skip=true
5、上传到我的tomcat 7的webapp下,可以改名为 dubbo-admin.war ,启动tomcat
[root@localhost apache-tomcat-7.0.47]# bin/startup.sh
6、输入网址 具体地址 根据自己的 IP 来定
http://192.168.126.132:8080/dubbo-admin/
默认用户密码: root root
注意:
说说问题 : 以上是 dubbo-admin 和 zookeeper 在一台机器上安装的
所以 这里 dubbo-admin --> WEB-INF --> dubbo.properties 文件的地址 默认为 127.0.0.1
如果安装在不同的机器上,这里的 地址 要修改成 zookeeper 所在 机器的IP地址 。
本来想免费给大家用的 ,竟然最低 1积分 限制 ,对于没有积分的童鞋 可以留言 我发邮件给你们 !
如果有帮助到大家 是我的荣幸 。 谢谢 !!!