buctwp opened a new issue, #12099:
URL: https://github.com/apache/dubbo/issues/12099

   pom.xml
   ================
           <!--dubbo依赖-->
           <dependency>
               <groupId>org.apache.dubbo</groupId>
               <artifactId>dubbo-spring-boot-starter</artifactId>
               <version>3.1.3</version>
           </dependency>
           <dependency>
               <groupId>org.apache.dubbo</groupId>
               <artifactId>dubbo</artifactId>
               <version>3.1.3</version>
           </dependency>
   
   
   
   
   消费者 的xml配置
   dubbo-userservice-client.xml
   ================
       <!--声明服务消费者名称-->
       <dubbo:application name="dubbo-userservice-client"></dubbo:application>
   
       <!--引用远程接口服务-->
       <dubbo:reference id="userService"
                        interface="com.bjpowernode.dubbo.service.UserService"
                        url="dubbo://localhost:20880"
                        registry="N/A"
                        check="false">
       </dubbo:reference>
   
   启动时报错:
   org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'userService': Invocation of init method failed; nested exception is 
java.lang.ClassCastException: org.apache.dubbo.config.RegistryConfig cannot be 
cast to [Ljava.lang.String;
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$222/1042790962.getObject(Unknown
 Source) ~[na:na]
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:934)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
 ~[spring-context-5.3.20.jar:5.3.20]
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
 ~[spring-context-5.3.20.jar:5.3.20]
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
 ~[spring-boot-2.5.14.jar:2.5.14]
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) 
[spring-boot-2.5.14.jar:2.5.14]
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:453)
 [spring-boot-2.5.14.jar:2.5.14]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:343) 
[spring-boot-2.5.14.jar:2.5.14]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1370) 
[spring-boot-2.5.14.jar:2.5.14]
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1359) 
[spring-boot-2.5.14.jar:2.5.14]
        at 
com.bjpowernode.dubbo.client.dubbouserserviceclient.DubboUserserviceClientApplication.main(DubboUserserviceClientApplication.java:14)
 [classes/:na]
   Caused by: java.lang.ClassCastException: 
org.apache.dubbo.config.RegistryConfig cannot be cast to [Ljava.lang.String;
        at 
org.apache.dubbo.config.spring.reference.ReferenceBeanSupport.convertReferenceProps(ReferenceBeanSupport.java:95)
 ~[dubbo-3.1.3.jar:3.1.3]
        at 
org.apache.dubbo.config.spring.reference.ReferenceCreator.populateBean(ReferenceCreator.java:168)
 ~[dubbo-3.1.3.jar:3.1.3]
        at 
org.apache.dubbo.config.spring.reference.ReferenceCreator.configureBean(ReferenceCreator.java:109)
 ~[dubbo-3.1.3.jar:3.1.3]
        at 
org.apache.dubbo.config.spring.reference.ReferenceCreator.build(ReferenceCreator.java:95)
 ~[dubbo-3.1.3.jar:3.1.3]
        at 
org.apache.dubbo.config.spring.reference.ReferenceBeanManager.initReferenceBean(ReferenceBeanManager.java:176)
 ~[dubbo-3.1.3.jar:3.1.3]
        at 
org.apache.dubbo.config.spring.reference.ReferenceBeanManager.addReference(ReferenceBeanManager.java:91)
 ~[dubbo-3.1.3.jar:3.1.3]
        at 
org.apache.dubbo.config.spring.ReferenceBean.afterPropertiesSet(ReferenceBean.java:240)
 ~[dubbo-3.1.3.jar:3.1.3]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
 ~[spring-beans-5.3.20.jar:5.3.20]
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
 ~[spring-beans-5.3.20.jar:5.3.20]
        ... 17 common frames omitted
   
   按在线文档上说,registry="N/A",有url直连配置,这个属性是可以省略的。去掉这个属性后,又报没有任何registry的错误。


-- 
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