一、到GitHub上下载dubbo(https://github.com/dangdangdotcom/dubbox)
二、构建dubbo-admin war包
1.进入dubbo-admin文件夹
2.用mvn进行打包
直接在此输入cmd可以打开终端,且终端默认路径已经在此文件夹下。
mvn clean
mvn package
打包会出现下面的报错,修改pom.xml文件的依赖版本,再次打包即可。
3.在此目录的target目录下即可查看到war包。
三、部署dubbo-admin.war
1.将此war包放入到tomcat的webapps文件夹中,这里以我本地Windows为例:
2.启动tomcat,bin目录的startup.bat双击即可(若双击出现闪退情况,请检查tomcat的环境变量是否配置完毕或tomcat是否损坏)
3.部署报错
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 excepti
on 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.fact
ory.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?
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)
参考此篇文章 解决方法
访问http://localhost:8080+/war包解压后的文件夹名称
如:http://localhost:8080/dubbo-admin-2.8.4
至此即搭建完成dubbo的后台管理~~~