dubbo与springMVC直连报错

在尝试将dubbo服务与SpringMVC应用程序集成时遇到了初始化错误。具体表现为:在创建'userService' bean时,初始化方法失败,导致了ClassCastException,无法将org.apache.dubbo.config.RegistryConfig转换为[String]。此问题可能源于配置不正确或依赖注入的异常。
摘要由CSDN通过智能技术生成

21-Aug-2022 22:20:33.859 璀﹀憡 [RMI TCP Connection(3)-127.0.0.1] org.springframework.context.support.AbstractApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Invocation of init method failed; nested exception is java.lang.ClassCastException: class org.apache.dubbo.config.RegistryConfig cannot be cast to class [Ljava.lang.String; (org.apache.dubbo.config.RegistryConfig is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @5734a006; [Ljava.lang.String; is in module java.base of loader 'bootstrap')
21-Aug-2022 22:20:33.867 涓ラ噸 [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.servlet.FrameworkServlet.initServletBean Context initialization failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Invocation of init method failed; nested exception is java.lang.ClassCastException: class org.apache.dubbo.config.RegistryConfig cannot be cast to class [Ljava.lang.String; (org.apache.dubbo.config.RegistryConfig is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @5734a006; [Ljava.lang.String; is in module java.base of loader 'bootstrap')
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值