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

Dubbo3.0.1好像有BUG,不太确定,发一下吧! #8489

Closed
startjava opened this issue Aug 12, 2021 · 3 comments
Closed

Dubbo3.0.1好像有BUG,不太确定,发一下吧! #8489

startjava opened this issue Aug 12, 2021 · 3 comments

Comments

@startjava
Copy link

@DubboReference(loadbalance = LoadbalanceRules.CONSISTENT_HASH, parameters = {"hash.arguments", "0,100"})

启动报错------------------------------------------

C:\Users\Administrator\.jdks\openjdk-14.0.1\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -javaagent:C:\ideaIU-2021.1.1.win\lib\idea_rt.jar=13793:C:\ideaIU-2021.1.1.win\bin -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath C:\Users\Administrator\Desktop\Dubbo3_Demo\my-loadbalance-consumer\target\classes;C:\mvn_repository\org\springframework\boot\spring-boot-starter\2.5.3\spring-boot-starter-2.5.3.jar;C:\mvn_repository\org\springframework\boot\spring-boot\2.5.3\spring-boot-2.5.3.jar;C:\mvn_repository\org\springframework\spring-context\5.3.9\spring-context-5.3.9.jar;C:\mvn_repository\org\springframework\boot\spring-boot-autoconfigure\2.5.3\spring-boot-autoconfigure-2.5.3.jar;C:\mvn_repository\org\springframework\boot\spring-boot-starter-logging\2.5.3\spring-boot-starter-logging-2.5.3.jar;C:\mvn_repository\ch\qos\logback\logback-classic\1.2.4\logback-classic-1.2.4.jar;C:\mvn_repository\ch\qos\logback\logback-core\1.2.4\logback-core-1.2.4.jar;C:\mvn_repository\org\apache\logging\log4j\log4j-to-slf4j\2.14.1\log4j-to-slf4j-2.14.1.jar;C:\mvn_repository\org\apache\logging\log4j\log4j-api\2.14.1\log4j-api-2.14.1.jar;C:\mvn_repository\org\slf4j\jul-to-slf4j\1.7.32\jul-to-slf4j-1.7.32.jar;C:\mvn_repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\mvn_repository\org\springframework\spring-core\5.3.9\spring-core-5.3.9.jar;C:\mvn_repository\org\springframework\spring-jcl\5.3.9\spring-jcl-5.3.9.jar;C:\mvn_repository\org\yaml\snakeyaml\1.28\snakeyaml-1.28.jar;C:\mvn_repository\org\springframework\boot\spring-boot-starter-web\2.5.3\spring-boot-starter-web-2.5.3.jar;C:\mvn_repository\org\springframework\boot\spring-boot-starter-json\2.5.3\spring-boot-starter-json-2.5.3.jar;C:\mvn_repository\com\fasterxml\jackson\core\jackson-databind\2.12.4\jackson-databind-2.12.4.jar;C:\mvn_repository\com\fasterxml\jackson\core\jackson-annotations\2.12.4\jackson-annotations-2.12.4.jar;C:\mvn_repository\com\fasterxml\jackson\core\jackson-core\2.12.4\jackson-core-2.12.4.jar;C:\mvn_repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.12.4\jackson-datatype-jdk8-2.12.4.jar;C:\mvn_repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.12.4\jackson-datatype-jsr310-2.12.4.jar;C:\mvn_repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.12.4\jackson-module-parameter-names-2.12.4.jar;C:\mvn_repository\org\springframework\boot\spring-boot-starter-tomcat\2.5.3\spring-boot-starter-tomcat-2.5.3.jar;C:\mvn_repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.50\tomcat-embed-core-9.0.50.jar;C:\mvn_repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.50\tomcat-embed-el-9.0.50.jar;C:\mvn_repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.50\tomcat-embed-websocket-9.0.50.jar;C:\mvn_repository\org\springframework\spring-web\5.3.9\spring-web-5.3.9.jar;C:\mvn_repository\org\springframework\spring-beans\5.3.9\spring-beans-5.3.9.jar;C:\mvn_repository\org\springframework\spring-webmvc\5.3.9\spring-webmvc-5.3.9.jar;C:\mvn_repository\org\springframework\spring-aop\5.3.9\spring-aop-5.3.9.jar;C:\mvn_repository\org\springframework\spring-expression\5.3.9\spring-expression-5.3.9.jar;C:\mvn_repository\org\apache\dubbo\dubbo-spring-boot-starter\3.0.1\dubbo-spring-boot-starter-3.0.1.jar;C:\mvn_repository\org\apache\dubbo\dubbo-spring-boot-autoconfigure\3.0.1\dubbo-spring-boot-autoconfigure-3.0.1.jar;C:\mvn_repository\org\apache\dubbo\dubbo-spring-boot-autoconfigure-compatible\3.0.1\dubbo-spring-boot-autoconfigure-compatible-3.0.1.jar;C:\mvn_repository\org\apache\dubbo\dubbo\3.0.1\dubbo-3.0.1.jar;C:\mvn_repository\com\alibaba\spring\spring-context-support\1.0.8\spring-context-support-1.0.8.jar;C:\mvn_repository\org\javassist\javassist\3.23.1-GA\javassist-3.23.1-GA.jar;C:\mvn_repository\org\eclipse\collections\eclipse-collections\10.4.0\eclipse-collections-10.4.0.jar;C:\mvn_repository\org\eclipse\collections\eclipse-collections-api\10.4.0\eclipse-collections-api-10.4.0.jar;C:\mvn_repository\io\netty\netty-all\4.1.66.Final\netty-all-4.1.66.Final.jar;C:\mvn_repository\com\google\code\gson\gson\2.8.7\gson-2.8.7.jar;C:\mvn_repository\com\alibaba\fastjson\1.2.70\fastjson-1.2.70.jar;C:\mvn_repository\org\roaringbitmap\RoaringBitmap\0.9.0\RoaringBitmap-0.9.0.jar;C:\mvn_repository\org\roaringbitmap\shims\0.9.0\shims-0.9.0.jar;C:\mvn_repository\org\apache\curator\curator-x-discovery\4.0.1\curator-x-discovery-4.0.1.jar;C:\mvn_repository\org\apache\curator\curator-recipes\4.0.1\curator-recipes-4.0.1.jar;C:\mvn_repository\org\apache\curator\curator-framework\4.0.1\curator-framework-4.0.1.jar;C:\mvn_repository\org\apache\curator\curator-client\4.0.1\curator-client-4.0.1.jar;C:\mvn_repository\com\google\guava\guava\20.0\guava-20.0.jar;C:\mvn_repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;C:\mvn_repository\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar;C:\mvn_repository\org\apache\zookeeper\zookeeper\3.7.0\zookeeper-3.7.0.jar;C:\mvn_repository\org\apache\zookeeper\zookeeper-jute\3.7.0\zookeeper-jute-3.7.0.jar;C:\mvn_repository\org\apache\yetus\audience-annotations\0.12.0\audience-annotations-0.12.0.jar;C:\mvn_repository\io\netty\netty-handler\4.1.66.Final\netty-handler-4.1.66.Final.jar;C:\mvn_repository\io\netty\netty-common\4.1.66.Final\netty-common-4.1.66.Final.jar;C:\mvn_repository\io\netty\netty-resolver\4.1.66.Final\netty-resolver-4.1.66.Final.jar;C:\mvn_repository\io\netty\netty-buffer\4.1.66.Final\netty-buffer-4.1.66.Final.jar;C:\mvn_repository\io\netty\netty-transport\4.1.66.Final\netty-transport-4.1.66.Final.jar;C:\mvn_repository\io\netty\netty-codec\4.1.66.Final\netty-codec-4.1.66.Final.jar;C:\mvn_repository\io\netty\netty-transport-native-epoll\4.1.66.Final\netty-transport-native-epoll-4.1.66.Final.jar;C:\mvn_repository\io\netty\netty-transport-native-unix-common\4.1.66.Final\netty-transport-native-unix-common-4.1.66.Final.jar;C:\mvn_repository\org\slf4j\slf4j-api\1.7.32\slf4j-api-1.7.32.jar;C:\mvn_repository\org\slf4j\slf4j-log4j12\1.7.32\slf4j-log4j12-1.7.32.jar;C:\mvn_repository\log4j\log4j\1.2.16\log4j-1.2.16.jar;C:\Users\Administrator\Desktop\Dubbo3_Demo\my-api\target\classes com.ghy.www.my.loadbalance.consumer.Application
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/mvn_repository/ch/qos/logback/logback-classic/1.2.4/logback-classic-1.2.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/mvn_repository/org/slf4j/slf4j-log4j12/1.7.32/slf4j-log4j12-1.7.32.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
2021-08-12 17:54:20.493  INFO 12588 --- [           main] d.s.b.c.e.WelcomeLogoApplicationListener : 

 :: Dubbo Spring Boot (v3.0.1) : https://github.com/apache/dubbo-spring-boot-project
 :: Dubbo (v3.0.1) : https://github.com/apache/dubbo
 :: Discuss group : dev@dubbo.apache.org


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.3)

2021-08-12 17:54:20.590  INFO 12588 --- [           main] c.g.w.m.l.consumer.Application           : Starting Application using Java 14.0.1 on gaohongyan with PID 12588 (C:\Users\Administrator\Desktop\Dubbo3_Demo\my-loadbalance-consumer\target\classes started by Administrator in C:\Users\Administrator\Desktop\Dubbo3_Demo)
2021-08-12 17:54:20.590  INFO 12588 --- [           main] c.g.w.m.l.consumer.Application           : No active profile set, falling back to default profiles: default
log4j:WARN No appenders could be found for logger (org.apache.dubbo.config.context.ConfigManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2021-08-12 17:54:21.961  INFO 12588 --- [           main] o.s.c.a.ConfigurationClassPostProcessor  : Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2021-08-12 17:54:22.058  INFO 12588 --- [           main] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: iService1 = ReferenceBean:com.ghy.www.api.IService1(loadbalance=random) at private com.ghy.www.api.IService1 com.ghy.www.my.loadbalance.consumer.javaconfig.JavaConfigDubbo.iService1
2021-08-12 17:54:22.058  INFO 12588 --- [           main] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: iService2 = ReferenceBean:com.ghy.www.api.IService2(loadbalance=roundrobin) at private com.ghy.www.api.IService2 com.ghy.www.my.loadbalance.consumer.javaconfig.JavaConfigDubbo.iService2
2021-08-12 17:54:22.058  INFO 12588 --- [           main] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: iService3 = ReferenceBean:com.ghy.www.api.IService3(loadbalance=leastactive) at private com.ghy.www.api.IService3 com.ghy.www.my.loadbalance.consumer.javaconfig.JavaConfigDubbo.iService3
2021-08-12 17:54:22.076 ERROR 12588 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.RuntimeException: Prepare dubbo reference injection element failed
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.postProcessBeanFactory(ReferenceAnnotationBeanPostProcessor.java:153) ~[dubbo-3.0.1.jar:3.0.1]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:325) ~[spring-context-5.3.9.jar:5.3.9]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:191) ~[spring-context-5.3.9.jar:5.3.9]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.9.jar:5.3.9]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.9.jar:5.3.9]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.3.jar:2.5.3]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.3.jar:2.5.3]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.3.jar:2.5.3]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.3.jar:2.5.3]
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) ~[spring-boot-2.5.3.jar:2.5.3]
	at com.ghy.www.my.loadbalance.consumer.Application.main(Application.java:12) ~[classes/:na]
Caused by: java.lang.IllegalArgumentException: pairs must be even.
	at org.apache.dubbo.common.utils.CollectionUtils.toStringMap(CollectionUtils.java:192) ~[dubbo-3.0.1.jar:3.0.1]
	at org.apache.dubbo.config.spring.reference.ReferenceCreator.convertStringArrayToMap(ReferenceCreator.java:332) ~[dubbo-3.0.1.jar:3.0.1]
	at org.apache.dubbo.config.spring.reference.ReferenceBeanSupport.convertToString(ReferenceBeanSupport.java:151) ~[dubbo-3.0.1.jar:3.0.1]
	at org.apache.dubbo.config.spring.reference.ReferenceBeanSupport.generateReferenceKey(ReferenceBeanSupport.java:117) ~[dubbo-3.0.1.jar:3.0.1]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.registerReferenceBean(ReferenceAnnotationBeanPostProcessor.java:365) ~[dubbo-3.0.1.jar:3.0.1]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.prepareInjection(ReferenceAnnotationBeanPostProcessor.java:317) ~[dubbo-3.0.1.jar:3.0.1]
	at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.postProcessBeanFactory(ReferenceAnnotationBeanPostProcessor.java:149) ~[dubbo-3.0.1.jar:3.0.1]
	... 10 common frames omitted

2021-08-12 17:54:22.078  INFO 12588 --- [           main] f.a.ReferenceAnnotationBeanPostProcessor : class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!

Process finished with exit code 1
@dkisser
Copy link

dkisser commented Aug 16, 2021

Look at the document of @DubboReference

Customized parameter key-value pair, for example: {key1, value1, key2, value2} or {"key1=value1", "key2=value2"}

@startjava
Copy link
Author

startjava commented Aug 16, 2021 via email

@kylixs
Copy link
Member

kylixs commented Aug 17, 2021

It seems the problem has bean fixed: #8414

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

3 participants