错误消息:
|严重: 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×tamp=1553236601190, cause: Fail to decode request due to: RpcInvocation [methodName=
dubbo项目中使用SpringMVC做文件上传,对于使用MultipartFile文件传输时,报错Fail to decode request due to: RpcInvocation。
最新推荐文章于 2023-11-02 20:31:33 发布
在Dubbo项目中遇到使用SpringMVC上传MultipartFile时的RpcException,原因是dubbo无法跨系统传递接口实现类。通过引入Hessian解决此问题,包括在pom文件中排除servlet-api依赖,配置Springmvc文件上传,服务提供方注册Hessian协议,消费者方引用Hessian服务,以及在Controller和服务层中转换为byte数组进行文件传输。
摘要由CSDN通过智能技术生成