gang0713 commented on issue #8511:
URL: https://github.com/apache/dubbo/issues/8511#issuecomment-899339899


   **接口定义:**
   @DubboService(version = "${platform.service.version}", group = 
"${platform.service.group}", interfaceClass = IOperateRecordService.class)
   public class OperateRecordServiceImpl extends BaseServiceImpl implements 
IOperateRecordService {
   
   **消费端注入:**
      @DubboReference(version = "${platform.service.version}", group = 
"${platform.service.group}", lazy = true)
       @Lazy
       private IOperateRecordService operateRecordService;
   
   
   很奇怪,一样的代码,我使用2.7.7启动访问都正常,升级到2.7.8-2.7.13都会报<dubbo:service interface="" /> 
interface not allow null!
   Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 
'ServiceBean:com.abc.modules.sysuser.services.ISysUserManageService:1.0.0:dev': 
Cannot resolve reference to bean 'sysUserManageServiceImpl' while setting bean 
property 'ref'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'sysUserManageServiceImpl': Injection of @DubboReference dependencies 
is failed; nested exception is java.lang.IllegalStateException: <dubbo:service 
interface="" /> interface not allow null!
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:113)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1702)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
   
   
   
   
   
   **使用.dubbo3.0.0和3.0.1都正常,升级到3.0.2报下面的错**
   
   Error starting ApplicationContext. To display the conditions report re-run 
your application with 'debug' enabled.
   2021-08-16 16:51:10.318 ERROR 31968 --- [           main] 
o.s.b.SpringApplication                  : Application run failed
   
   org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'companyServiceImpl': Injection of @DubboReference dependencies is 
failed; nested exception is java.lang.IllegalArgumentException: Can not set 
com.abc.modules.expand.services.IOperateRecordService field 
com.abc.modules.company.services.impl.CompanyServiceImpl.operateRecordService 
to com.sun.proxy.$Proxy156
        at 
org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.postProcessPropertyValues(ReferenceAnnotationBeanPostProcessor.java:306)
 ~[dubbo-3.0.2.jar:3.0.2]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1430)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
 ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
 ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
 ~[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:755) 
~[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:402)
 [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:312) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1247) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1236) 
[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
        at 
com.xykq.platform.PlatformApplication.main(PlatformApplication.java:20) 
[classes/:?]
   Caused by: java.lang.IllegalArgumentException: Can not set 
com.xykq.modules.expand.services.IOperateRecordService field 
com.xykq.modules.company.services.impl.CompanyServiceImpl.operateRecordService 
to com.sun.proxy.$Proxy156
        at 
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
 ~[?:1.8.0_201]
        at 
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
 ~[?:1.8.0_201]
        at 
sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
 ~[?:1.8.0_201]
        at java.lang.reflect.Field.set(Field.java:764) ~[?:1.8.0_201]
        at 
org.apache.dubbo.config.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedInjectElement.inject(AbstractAnnotationBeanPostProcessor.java:470)
 ~[dubbo-3.0.2.jar:3.0.2]
        at 
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
 ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at 
org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.postProcessPropertyValues(ReferenceAnnotationBeanPostProcessor.java:302)
 ~[dubbo-3.0.2.jar:3.0.2]
        ... 18 more


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to