Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo-demo-annotation-consumer run failed #3242

Closed
2 tasks done
pursueLife opened this issue Jan 16, 2019 · 5 comments
Closed
2 tasks done

dubbo-demo-annotation-consumer run failed #3242

pursueLife opened this issue Jan 16, 2019 · 5 comments
Assignees
Milestone

Comments

@pursueLife
Copy link

pursueLife commented Jan 16, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.0
  • Operating System version: window
  • Java version: jdk8

Steps to reproduce this issue

  1. dubbo-demo-annotation-consumer.Application 启动main()方法报错

[16/01/19 11:17:43:179 CST] main INFO annotation.ReferenceAnnotationBeanPostProcessor: class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoServiceComponent': Injection of @reference dependencies failed; nested exception is java.lang.UnsupportedOperationException
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.postProcessPropertyValues(ReferenceAnnotationBeanPostProcessor.java:105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.context.annotation.AnnotationConfigApplicationContext.(AnnotationConfigApplicationContext.java:84)
at org.apache.dubbo.demo.consumer.Application.main(Application.java:36)
Caused by: java.lang.UnsupportedOperationException
at java.util.concurrent.CopyOnWriteArrayList$COWIterator.set(CopyOnWriteArrayList.java:1185)
at java.util.Collections.sort(Collections.java:170)
at org.apache.dubbo.rpc.cluster.RouterChain.sort(RouterChain.java:87)
at org.apache.dubbo.rpc.cluster.RouterChain.initWithRouters(RouterChain.java:67)
at org.apache.dubbo.rpc.cluster.RouterChain.(RouterChain.java:57)
at org.apache.dubbo.rpc.cluster.RouterChain.buildChain(RouterChain.java:46)
at org.apache.dubbo.registry.integration.RegistryDirectory.buildRouterChain(RegistryDirectory.java:584)
at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:378)
at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:361)
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:65)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:114)
at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:372)
at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:312)
at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:236)
at org.apache.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:70)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceFieldElement.inject(ReferenceAnnotationBeanPostProcessor.java:376)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.postProcessPropertyValues(ReferenceAnnotationBeanPostProcessor.java:101)
... 12 more

@pursueLife
Copy link
Author

pursueLife commented Jan 16, 2019

RouterChain类
this.routers = new CopyOnWriteArrayList<>(builtinRouters);
this.sort();
CopyOnWriteArrayList不支持Collections.sort

@CrazyHZM
Copy link
Member

thank you , I will fix it

CrazyHZM added a commit to CrazyHZM/dubbo that referenced this issue Jan 16, 2019
@pursueLife
Copy link
Author

pursueLife commented Jan 16, 2019

Thats all right!

@shjk
Copy link

shjk commented Mar 14, 2019

2.7.1-SNAPSHOT 启动 dubbo-demo-api-consumer 也报这样的错误

Exception in thread "main" java.lang.UnsupportedOperationException
at java.util.concurrent.CopyOnWriteArrayList$COWIterator.set(CopyOnWriteArrayList.java:1185)
at java.util.Collections.sort(Collections.java:170)
at org.apache.dubbo.rpc.cluster.RouterChain.sort(RouterChain.java:87)

@ylylc
Copy link

ylylc commented Apr 9, 2019

我也遇到了这个问题,解决办法是:提高jdk版本到1.8.0_90以上试试。我的1.8.0_92的可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants