java教程

java基础教程,java视频教程,java pdf电子书下载,java免费视频教程,java视频教程下载

dubbo-admin部署在jdk 1.8上出错的解决方案

2016-07-26| 发布: | 浏览: 3529 |保存PDF

如果你把dubbo-admin部署在jdk 1.8上,会出现以下错误:
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)


反编译dubbo的代码看了一下,发现getter和setter方法确实不是很符合规范:


在官方的issues也讨论相关问题:https://github.com/alibaba/dubbo/issues/50


第一种解决方案:

重新安装了jdk 1.7后,问题解决。


第二种解决方案:

假设你想你的开发环境是1.8,你可以直接装个1.7.在setclasspath.bat(linux下是setclasspath.sh)中设置JAVA_HOME
set JAVA_HOME=C:\dev\Java\jdk1.7.0_21
set JRE_HOME=C:\dev\Java\jdk1.7.0_21\jre


第三种解决方案:
到这里慢慢找,我没有尝试过:https://github.com/alibaba/dubbo/issues/50


书生参考于网络整理


系列教程

大家都在看

热门访问