centos 7下安装配置dubbo-admin

简介:

1、安装好tomcat之后,

下载并且编译最新的dubbo-admin 如图:

wKioL1kC0JWQ4QZxAAB-qK3tSjQ574.png-wh_50

1、修改WEB-INF中的dubbo.properties

dubbo.registry.address=zookeeper://192.168.1.87:2181//zookeeper的地址

dubbo.admin.root.password=root
dubbo.admin.guest.password=guest

2、删除原tomcat/webapps/ROOT目录下的所有文件,同时复制dubbo-admin解压后的内容到tomcat/webapps/ROOT中

3、启动tomcat

4、访问对应的ip地址

如果出现:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  INFO context.InheritableListableBeanFactory - Destroying singletons in com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory @55af05cd : defining beans [org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,com.alibaba.citrus.service.configuration.support.PropertyPlaceholderConfigurer# 0 ,templateService,mappingRuleService,dataResolverService,exceptionPipeline,resourceLoadingService,messageSource,uriBrokerService,restfulRewrite,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer# 0 ,dubbo-admin,com.alibaba.dubbo.config.RegistryConfig,registryService,configService,consumerService,overrideService,ownerService,providerService,routeService,userService,governanceCache,productionModeSensiblePostProcessor,webxConfiguration,requestContexts,com.alibaba.citrus.service.requestcontext.impl.RequestContextBeanFactoryPostProcessor# 0 ,uploadService,pullService,formService,module.screen.Error404,module.screen.ErrorOther,moduleLoaderService,messageResourceService,com.alibaba.citrus.webx.context.WebxComponentsLoader$WebxComponentsCreator]; root of factory hierarchy
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?
     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 )
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java: 126 )
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java: 1245 )
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java: 1010 )
142 )
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 617 )
     at java.lang.Thread.run(Thread.java: 745 )
Caused by: 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?
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java: 230 )
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java: 117 )
     at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java: 479 )
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java: 219 )
     ...  34  more
Caused by: 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?
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java: 1279 )
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java: 1010 )
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java: 472 )
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$ 1 .run(AbstractAutowireCapableBeanFactory.java: 409 )
     at java.security.AccessController.doPrivileged(Native Method)
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java: 380 )
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java: 219 )
     ...  44  more
Caused by: 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.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java: 801 )

这些错误 

原来是我用的jdk版本太高,jdk8, dubbo默认用的spring版本比较旧,冲突导致,作如下修改即可

1、webx的依赖改为3.1.6版;

1
2
3
4
5
<dependency>
         <groupId>com.alibaba.citrus</groupId>
         <artifactId>citrus-webx-all</artifactId>
         <version> 3.1 . 6 </version>
     </dependency>

2、添加velocity的依赖,我用了1.7;

1
2
3
4
5
  <dependency>
         <groupId>org.apache.velocity</groupId>
         <artifactId>velocity</artifactId>
         <version> 1.7 </version>
     </dependency>

3、对依赖项dubbo添加exclusion,避免引入旧spring

1
2
3
4
5
6
7
8
9
10
11
<dependency>
         <groupId>com.alibaba</groupId>
         <artifactId>dubbo</artifactId>
         <version>${project.parent.version}</version>
         <exclusions>
             <exclusion>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring</artifactId>
             </exclusion>
         </exclusions>
     </dependency>

4、webx已有spring 3以上的依赖,因此注释掉dubbo-admin里面的spring依赖

1
2
3
4
   <!--<dependency>-->
         <!--<groupId>org.springframework</groupId>-->
         <!--<artifactId>spring</artifactId>-->
     <!--</dependency>-->

重新编译dubbo放tomcat运行,成功启动!











本文转自yunlielai51CTO博客,原文链接:http://blog.51cto.com/4925054/1920385,如需转载请自行联系原作者

相关文章
|
3月前
|
应用服务中间件 Linux 网络安全
centos7 下离线安装gcc g++ nginx,并配置nginx进行网络流转发
centos7 下离线安装gcc g++ nginx,并配置nginx进行网络流转发
110 0
|
1月前
|
Java Linux
Flume【环境搭建 01】CentOS Linux release 7.5 安装配置 apache-flume-1.9.0 并验证
【2月更文挑战第16天】Flume【环境搭建 01】CentOS Linux release 7.5 安装配置 apache-flume-1.9.0 并验证
33 0
|
1月前
|
分布式计算 关系型数据库 MySQL
Sqoop【部署 01】CentOS Linux release 7.5 安装配置 sqoop-1.4.7 解决警告并验证(附Sqoop1+Sqoop2最新版安装包+MySQL驱动包资源)
【2月更文挑战第8天】Sqoop CentOS Linux release 7.5 安装配置 sqoop-1.4.7 解决警告并验证(附Sqoop1+Sqoop2最新版安装包+MySQL驱动包资源)
97 1
|
14天前
|
网络协议
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
15 0
|
1月前
|
运维 Linux 应用服务中间件
Centos7如何配置firewalld防火墙规则
Centos7如何配置firewalld防火墙规则
44 0
|
1月前
|
存储 监控 Linux
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
【2月更文挑战第17天】Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
28 1
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
|
2月前
|
关系型数据库 MySQL Linux
Azkaban【部署 02】CentOS release 7.5安装配置azkaban-3.70.0安装阶段(含已编译的10个安装文件:可直接进行安装)
【2月更文挑战第5天】CentOS release 7.5安装配置azkaban-3.70.0安装阶段(含已编译的10个安装文件:可直接进行安装)
48 7
|
2月前
|
Java Linux 开发工具
Azkaban【部署 01】Linux环境 CentOS Linux release 7.5.1804安装配置azkaban-3.70.0编译阶段(附安装包及gradle-4.6资源)
【2月更文挑战第4天】Linux环境 CentOS Linux release 7.5.1804安装配置azkaban-3.70.0编译阶段(附安装包及gradle-4.6资源)
32 1
|
2月前
|
Ubuntu Linux 网络安全
|
3月前
|
负载均衡 算法 Linux
百度搜索:蓝易云【Centos7系统Haproxy安装配置教程】
现在,HAProxy已经成功安装和配置在您的CentOS 7系统上。它将监听您配置的端口,并根据负载均衡策略将请求转发到后端服务器。您可以根据需要自定义更多的配置,如SSL终止、ACL和更复杂的负载均衡算法。请确保HAProxy的配置符合您的需求,并在进行更改之前备份配置文件,以防止意外的错误。
42 2