- [ ] I have searched the 
[issues](https://github.com/apache/incubator-dubbo/issues) of this repository 
and believe that this is not a duplicate.
- [ ] I have checked the 
[FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this 
repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.6.2
* Operating System version: win7
* Java version: 1.8

@Service注解中的interfaceName属性与ServiceConfig中的的属性名(interface)不一致,导致设置@Service注解的interfaceName属性时,找不到相应的setter方法,会报错无法启动服务:

org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 
'ServiceBean:myGenericService:com.alibaba.dubbo.rpc.service.GenericService:${demo.service.version}':
 Error setting property values; nested exception is 
org.springframework.beans.NotWritablePropertyException: Invalid property 
'interfaceName' of bean class [com.alibaba.dubbo.config.spring.ServiceBean]: 
Bean property 'interfaceName' 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:1648)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1363)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:580)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$104/1658699134.getObject(Unknown
 Source) ~[na:na]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
 ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
 ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
 ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) 
~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
 ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:327) 
~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
        at 
org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:137)
 [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
        at 
com.kingnet.blockdata.DubboProviderDemo.main(DubboProviderDemo.java:22) 
[classes/:na]
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid 
property 'interfaceName' of bean class 
[com.alibaba.dubbo.config.spring.ServiceBean]: Bean property 'interfaceName' 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.createNotWritablePropertyException(BeanWrapperImpl.java:243)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:426)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:97)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:77)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1644)
 ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
        ... 17 common frames omitted

2018-08-27 20:07:01.922  INFO 14500 --- [bboShutdownHook] 
com.alibaba.dubbo.config.AbstractConfig  :  [DUBBO] Run shutdown hook now., 
dubbo version: 2.6.2, current host: 192.168.56.1



[ Full content available at: 
https://github.com/apache/incubator-dubbo/issues/2353 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to