dubbox+thrift ClassCastException

你好吗你好吗 发布于 2017/06/08 14:51
阅读 503
收藏 0

正在直播: LF AI 基金会主办首届AICON 2022>>>

我使用的是dubbox 2.8.4+thrift,在某些情况下会报类型转换异常,报这个异常之后只能重启才能正常,在某些情况后又会抛异常,以下是异常堆栈。

[DUBBO] ChannelEventRunnable handle RECEIVED operation error, channel is NettyChannel [channel=[id: 0xbebe1b7d, /10.162.90.23:11451 => /10.51.38.65:30001]], message is Request [id=18, version=null, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=getAreaCountry, parameterTypes=[int, int], arguments=[1, 3], attachments={interface=com.yuntongxun.yoyo.service.AreaIconService$Iface}]], dubbo version: 2.0.0.1, current host: 127.0.0.1
com.alibaba.dubbo.remoting.RemotingException: Failed to send message Response [id=18, version=null, status=20, event=false, error=null, result=RpcResult [result=[AreaIcon(ID:110, area_name:泰国, area_code:Thailand, pic_url:/area/chaoshi_taiguo.png, update_time:2017-04-28 16:46:26.0, home_pic_url:/area/taiguo_mudidi.jpg, parentId:0, area_type:1), AreaIcon(ID:109, area_name:日本, area_code:riben, pic_url:/area/chaoshi_riben.png, update_time:2017-04-28 16:47:26.0, home_pic_url:/area/riben_mudidi.jpg, parentId:0, area_type:1), AreaIcon(ID:101, area_name:香港, area_code:hongkong, pic_url:/area/chaoshi_xianggang.png, update_time:2017-04-28 15:25:57.0, home_pic_url:/area/xianggang_mudidi.jpg, parentId:0, area_type:1), AreaIcon(ID:104, area_name:韩国, area_code:hanguo, pic_url:/area/chaoshi_hanguo.png, update_time:2017-04-28 14:00:35.0, home_pic_url:/area/hanguo_mudidi.jpg, parentId:0, area_type:1)], exception=null]] to /10.162.90.23:11451, cause: com.yuntongxun.yoyo.service.model.area.AreaIcon cannot be cast to com.yuntongxun.yoyo.service.model.activity.Activity
        at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:108) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:51) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:171) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) [yoyo-2.0.0.1.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_71]
        at java.lang.Thread.run(Thread.java:745) [?:1.7.0_71]
Caused by: java.lang.ClassCastException: com.yuntongxun.yoyo.service.model.area.AreaIcon cannot be cast to com.yuntongxun.yoyo.service.model.activity.Activity
        at com.yuntongxun.yoyo.service.ActivityService$getActivityList_result$getActivityList_resultStandardScheme.write(ActivityService.java:975) ~[yoyo-2.0.0.1.jar:?]
        at com.yuntongxun.yoyo.service.ActivityService$getActivityList_result$getActivityList_resultStandardScheme.write(ActivityService.java:1) ~[yoyo-2.0.0.1.jar:?]
        at com.yuntongxun.yoyo.service.ActivityService$getActivityList_result.write(ActivityService.java:879) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.rpc.protocol.thrift.ThriftCodec.encodeResponse(ThriftCodec.java:672) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.rpc.protocol.thrift.ThriftCodec.encode(ThriftCodec.java:105) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:81) ~[yoyo-2.0.0.1.jar:?]
        at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:66) ~[yoyo-2.0.0.1.jar:?]
        at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:59) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:99) ~[yoyo-2.0.0.1.jar:?]
        at org.jboss.netty.channel.Channels.write(Channels.java:704) ~[yoyo-2.0.0.1.jar:?]
        at org.jboss.netty.channel.Channels.write(Channels.java:671) ~[yoyo-2.0.0.1.jar:?]
        at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) ~[yoyo-2.0.0.1.jar:?]
        at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:98) ~[yoyo-2.0.0.1.jar:?]
        ... 7 more

加载中
0
你好吗你好吗
你好吗你好吗
该评论暂时无法显示,详情咨询 QQ 群:点此入群
0
你好吗你好吗
你好吗你好吗
该评论暂时无法显示,详情咨询 QQ 群:点此入群
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部