春天 - 无法序列化从HTTP调用远程服务结果

问题描述 投票:0回答:1

当我试图通过Spring的远程服务来调用一个适合我的方法会出现此错误。 错误如下:

org.springframework.remoting.RemoteAccessException: Cannot deserialize result from HTTP invoker remote service [remote service address]; 
nested exception is java.lang.ClassNotFoundException: default.CommonException
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:192)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:157)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy25.getQueryResult(Unknown Source)
at default.Main.main

有什么方法可以在问题引起的?从所有其他方法的结果反序列化时没有问题。

编辑:我尝试通过简单地得到这样的结果: Result res = remoteService.getResult(param);

java spring maven spring-remoting
1个回答
1
投票

远程服务抛出default.CommonException,然后由Spring远程序列化,然后试图反序列化:在这一点上,你得到的ClassNotFound的。

我想你没有default.CommonException对发送方的类路径,所以反序列化不起作用。

© www.soinside.com 2019 - 2024. All rights reserved.