返回顶部
首页 > 资讯 > 后端开发 > Python >springboot-dubbocannotbecastto问题及解决
  • 326
分享到

springboot-dubbocannotbecastto问题及解决

springbootdubbocannotbecasttospringbootdubbo问题 2023-05-18 05:05:51 326人浏览 安东尼

Python 官方文档:入门教程 => 点击学习

摘要

目录SpringBoot-dubbo cannot be cast todubbo报错总结1.dubbo consumer 调用provider报错(1)- No provider

springboot-dubbo cannot be cast to

使用Spring Boot 集成dubbo的时候遇到问题:

2018-05-22 14:41:35.108 ERROR 2224 --- [:20880-thread-2] c.a.dubbo.rpc.filter.ExceptionFilter     :  [DUBBO] Got unchecked and undeclared exception which called by 10.0.75.1. service: com.neo.facade.UseServiceFacade, method: getAll, exception: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method getAll to reGIStry://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.5.3&export=dubbo%3A%2F%2F10.0.75.1%3A20880%2Fcom.neo.facade.UseServiceFacade%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.5.3%26interface%3Dcom.neo.facade.UseServiceFacade%26methods%3DgetAll%2CgetOne%2Cupdate%2Cinsert%2Cdelete%26pid%3D2224%26revision%3D1.0.0%26side%3Dprovider%26timestamp%3D1526971274301%26version%3D1.0.0&pid=2224&registry=ZooKeeper×tamp=1526971274290, cause: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService, dubbo version: 2.5.3, current host: 127.0.0.1
 
com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method getAll to registry://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.5.3&export=dubbo%3A%2F%2F10.0.75.1%3A20880%2Fcom.neo.facade.UseServiceFacade%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.5.3%26interface%3Dcom.neo.facade.UseServiceFacade%26methods%3DgetAll%2CgetOne%2Cupdate%2Cinsert%2Cdelete%26pid%3D2224%26revision%3D1.0.0%26side%3Dprovider%26timestamp%3D1526971274301%26version%3D1.0.0&pid=2224&registry=zookeeper×tamp=1526971274290, cause: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) [dubbo-2.5.3.jar:2.5.3]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    at com.alibaba.dubbo.common.bytecode.Wrapper1.invokeMethod(Wrapper1.java) ~[na:2.5.3]
    at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) ~[dubbo-2.5.3.jar:2.5.3]
    ... 25 common frames omitted
Caused by: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    ... 28 common frames omitted
 
2018-05-22 14:41:35.126 ERROR 2224 --- [:20880-thread-3] c.a.dubbo.rpc.filter.ExceptionFilter     :  [DUBBO] Got unchecked and undeclared exception which called by 10.0.75.1. service: com.neo.facade.UseServiceFacade, method: getAll, exception: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method getAll to registry://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.5.3&export=dubbo%3A%2F%2F10.0.75.1%3A20880%2Fcom.neo.facade.UseServiceFacade%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.5.3%26interface%3Dcom.neo.facade.UseServiceFacade%26methods%3DgetAll%2CgetOne%2Cupdate%2Cinsert%2Cdelete%26pid%3D2224%26revision%3D1.0.0%26side%3Dprovider%26timestamp%3D1526971274301%26version%3D1.0.0&pid=2224&registry=zookeeper×tamp=1526971274290, cause: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService, dubbo version: 2.5.3, current host: 127.0.0.1
 
com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method getAll to registry://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.5.3&export=dubbo%3A%2F%2F10.0.75.1%3A20880%2Fcom.neo.facade.UseServiceFacade%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.5.3%26interface%3Dcom.neo.facade.UseServiceFacade%26methods%3DgetAll%2CgetOne%2Cupdate%2Cinsert%2Cdelete%26pid%3D2224%26revision%3D1.0.0%26side%3Dprovider%26timestamp%3D1526971274301%26version%3D1.0.0&pid=2224&registry=zookeeper×tamp=1526971274290, cause: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) [dubbo-2.5.3.jar:2.5.3]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    at com.alibaba.dubbo.common.bytecode.Wrapper1.invokeMethod(Wrapper1.java) ~[na:2.5.3]
    at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) ~[dubbo-2.5.3.jar:2.5.3]
    ... 25 common frames omitted
Caused by: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    ... 28 common frames omitted
 
2018-05-22 14:41:35.133 ERROR 2224 --- [:20880-thread-4] c.a.dubbo.rpc.filter.ExceptionFilter     :  [DUBBO] Got unchecked and undeclared exception which called by 10.0.75.1. service: com.neo.facade.UseServiceFacade, method: getAll, exception: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method getAll to registry://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.5.3&export=dubbo%3A%2F%2F10.0.75.1%3A20880%2Fcom.neo.facade.UseServiceFacade%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.5.3%26interface%3Dcom.neo.facade.UseServiceFacade%26methods%3DgetAll%2CgetOne%2Cupdate%2Cinsert%2Cdelete%26pid%3D2224%26revision%3D1.0.0%26side%3Dprovider%26timestamp%3D1526971274301%26version%3D1.0.0&pid=2224&registry=zookeeper×tamp=1526971274290, cause: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService, dubbo version: 2.5.3, current host: 127.0.0.1
 
com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method getAll to registry://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.5.3&export=dubbo%3A%2F%2F10.0.75.1%3A20880%2Fcom.neo.facade.UseServiceFacade%3Fanyhost%3Dtrue%26application%3Dprovider%26dubbo%3D2.5.3%26interface%3Dcom.neo.facade.UseServiceFacade%26methods%3DgetAll%2CgetOne%2Cupdate%2Cinsert%2Cdelete%26pid%3D2224%26revision%3D1.0.0%26side%3Dprovider%26timestamp%3D1526971274301%26version%3D1.0.0&pid=2224&registry=zookeeper×tamp=1526971274290, cause: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) [dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) [dubbo-2.5.3.jar:2.5.3]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    at com.alibaba.dubbo.common.bytecode.Wrapper1.invokeMethod(Wrapper1.java) ~[na:2.5.3]
    at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) ~[dubbo-2.5.3.jar:2.5.3]
    at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) ~[dubbo-2.5.3.jar:2.5.3]
    ... 25 common frames omitted
Caused by: java.lang.ClassCastException: com.neo.service.UserService cannot be cast to com.neo.service.UserService
    ... 28 common frames omitted

是由spring-boot-devtools引起的

 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

估计是和dubbo有点冲突

dubbo报错总结

作为一个dubbo使用新手,有必要总结一些常见的dubbo问题,提升解决问题的套路。

1.dubbo consumer 调用provider报错(1)- No provider available

问题

No provider available from registry xxx from service xxx on consumer xxx may be providers disabled or not registrered。

如下图所示:

dubbo报错

原因:  

根据源码的截图所示(下图),就两个原因: 

1)No service provider  

2)Service providers are disabled

源码分析

解决办法:  

1).provider部署分支不正确,部署正确的分支。  

2).consumer部署分支的zookeeper地址不正确。

2.dubbo consumer调用provider报错(2)

问题

com.alibaba.dubbo.rpc.RpcException: Rpc cluster invoker for interface xxx on consumer 10.2.4.63 use dubbo version 2.6.0.2 is now destroyed! Can not invoke any more.

问题截图

原因

源码分析

调用链路:invoke()–>checkWhetherDestroyed()

consumer端调用的时候,发现出现实例已经destory,就抛出此异常

怀疑是由于内存不足,dubbo进程触发了spring的destroy()方法,同时就执行到了AbstractClusterInvoker.destroy(),但是此时进程并没有挂掉,所以就出现了可以调用,但是调用失败的情况。

解决方法:  

1)查看provider服务器是否内存不够,kill掉不相干的进程。  

2)重启provider服务。

3.dubbo consumer 调用provider报错(3)- NoSuchMethodException

问题

Caused by: com.alibaba.dubbo.common.bytecode.NoSuchMethodException: Not found method “getSocialResourceByRegionId” in class com.missfresh.product.center.service.impl.SocialResourceServiceImpl.

问题截图

原因:  

dubbo服务部署的分支里没有相关接口的实现。

解决方法:  

部署对应的分支。或者是直接部署master。

4.dubbo consumer 调用provider报错(4)- Thread pool is EXHAUSTED!

问题

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method queryProductSalsPromotionTagList in the service com.missfresh.product.center.service.IProductCategorysService. Tried 1 times of the providers

问题截图

原因:

原因分析

如上图所示,provider服务支持的最大线程数为300。

解决方法:  

检查程序中并发采用的线程池初始化值,是否合理。最大线程个数不能大于300.

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。

--结束END--

本文标题: springboot-dubbocannotbecastto问题及解决

本文链接: https://lsjlt.com/news/211743.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作