ReStartForTD

从这重新开始吧!

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method 错误处理


通常 Dubbo 报错:“com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method”有两个原因:

 1,需要进行实例化的类没有进行实例化,具体没有实例化的类会在错误信息中显示,在错误信息中搜索“Serializable”
    即可找到将其实现序列化可消除错误。

 2,是在使用Dubbo提供服务是在主机上启动了虚拟机的网络,在Windows中具体可以,在运行中输入“CMD”在CMD窗口中输入"ifconfig"命令查看,

    如果有其他除本地的网络链接,通过命令或者将其手动禁止,再启动Dubbo服务可以解决问题。



错误信息:

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method addGoodsModel in the service cn.ennew.platform.goods.facade.GoodsInfoFacade.
 Tried 1 times of the providers [10.4.57.249:20601] (1/2) from the registry 127.0.0.1:2181 on the consumer 10.4.57.249 using the dubbo
version 2.5.3. Last error is: Failed to invoke remote method: addGoodsModel, provider:
dubbo://10.4.57.249:20601/cn.ennew.platform.goods.facade.GoodsInfoFacade?anyhost=true&application=webapps-wwwp&check=false&dubbo=2.5.3&interface=
cn.ennew.platform.goods.facade.GoodsInfoFacade&methods=offSell,getGoodsCommentCount,findInnovateGoodsByMainUserId,getGoodsById,getDepot,
isProductMoodelUsed,findGoodsInfoByPage,recreateGoodsModel,getCountGoodsInfo,findGoodsCommentByGoodsId,findGoodsInfoByGoods,findItemDetailByItemIds,
getGoodsInfoByGoodsId,modifyGoodsModel,getGoodsItemAttrs,findInnovateGoodsByStatus,onSell,getGoodsCountByHallId,getItemDetailByItemId,
findGoodsDetailByGoodsIds,getCountGoodsDetail,removeGoodstModelById,addGoodsModel,getCountByServicePromiseId,
addServicePromise&payload=168388608&pid=7572&retries=0&revision=1.0.1-SNAPSHOT&serialization=dubbo&side=consumer&timeout=50000&timestamp=1459933256171,
 cause: Failed to send message Request [id=8, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=addGoodsModel,
 parameterTypes=[class cn.ennew.platform.goods.dto.GoodsInfoModelDTO], arguments=[cn.ennew.platform.goods.dto.GoodsInfoModelDTO@5e8bd9ef],
attachments={path=cn.ennew.platform.goods.facade.GoodsInfoFacade, interface=cn.ennew.platform.goods.facade.GoodsInfoFacade,
timeout=50000, version=0.0.0}]] to /10.4.57.249:20601, cause: Serialized class cn.ennew.platform.goods.dto.GoodsAptitudeInfoDTO
must implement java.io.Serializable (dubbo codec setting: isAllowNonSerializable = false)


阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wjb_2016/article/details/51084916
个人分类: 常见问题记录
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭