Dubbo传输序列化自定义异常时错误

1. org.apache.dubbo.rpc.RpcException: Failed to invoke the method findById in the service com.zzx.shoppingmall_common.service.BrandService. Tried 3 times of the providers [192.168.126.1:20880] (1/1) from the registry 192.168.126.31:2181 on the consumer 192.168.126.1 using the dubbo version 2.7.8. Last error is: Failed to invoke remote method: findById, provider: dubbo://192.168.126.1:20880/com.zzx.shoppingmall_common.service.BrandService?anyhost=true&application=shoppingmall_manager_api&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&init=false&interface=com.zzx.shoppingmall_common.service.BrandService&metadata-type=remote&methods=findById&pid=20004&qos.enable=false&register.ip=192.168.126.1&release=2.7.8&remote.application=shoppingmall_goods_service&side=consumer&sticky=false&timestamp=1692150209836, cause: org.apache.dubbo.remoting.RemotingException: com.alibaba.com.caucho.hessian.io.HessianProtocolException: ‘com.zzx.shoppingmall_common.exception.BusException’ could not be instantiated

解决方案:是因为通用模块的自定义异常需要增加一个无参构造方法,否则consumer将报HessianProtocolException: ‘xxxxException’ could not be instantiated异常并无法获取provider端的异常信息。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值