dubbo项目中使用SpringMVC做文件上传,对于使用MultipartFile文件传输时,报错Fail to decode request due to: RpcInvocation。

在Dubbo项目中遇到使用SpringMVC上传MultipartFile时的RpcException,原因是dubbo无法跨系统传递接口实现类。通过引入Hessian解决此问题,包括在pom文件中排除servlet-api依赖,配置Springmvc文件上传,服务提供方注册Hessian协议,消费者方引用Hessian服务,以及在Controller和服务层中转换为byte数组进行文件传输。
摘要由CSDN通过智能技术生成

错误消息:
|严重: Servlet.service() for servlet [taotao-manager-web] in context with path [] threw exception [Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method uploadPicture in the service com.taotao.manager.service.PictureService. Tried 3 times of the providers [192.168.138.1:20880] (1/1) from the registry 192.168.138.128:2181 on the consumer 192.168.138.1 using the dubbo version 2.5.3. Last error is: Failed to invoke remote method: uploadPicture, provider: dubbo://192.168.138.1:20880/com.taotao.manager.service.PictureService?anyhost=true&application=taotao-manager-web&check=false&dubbo=2.5.3&interface=com.taotao.manager.service.PictureService&methods=uploadPicture&pid=20660&revision=1.0-SNAPSHOT&side=consumer&timeout=1000000&timestamp=1553236601190, cause: Fail to decode request due to: RpcInvocation [methodName=

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值