您的位置:首页 > 大数据 > 人工智能

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

2016-04-07 12:41 519 查看
通常 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×tamp=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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: