简体   繁体   English

java.rmi.MarshalException

[英]java.rmi.MarshalException

whenever I try to call my ejb from a client, I get this error : 每当我尝试从客户端调用ejb时,都会出现此错误:

  java.rmi.MarshalException: Failed to communicate. 

    Problem during     marshalling/unmarshalling; nested exception is: 

    java.io.InvalidClassException: com.afrikbrain.util.message.MessageInfo;

    local     class incompatible:

   stream classdesc serialVersionUID = 2285009932770474121, 

   local class     serialVersionUID = -2900394430145132451 at      

  org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker
.java:122)

why is it occuring ? 为什么会发生? and how to solve it ? 以及如何解决呢?

The local class and the remote class are differente versions. 本地类和远程类是不同的版本。 During the unmarshalling process the receiver does not support the protocol version of the sender. 在解组过程中,接收方不支持发送方的协议版本。 Make sure the compiled class on the server is the same version of the compiled class on the client, so can be serialized/deserialized without problems. 确保服务器上的已编译类与客户端上的已编译类版本相同,因此可以对其进行序列化/反序列化而不会出现问题。 I suggest you rebuilding from zero all the project and redeploying them, and regenerate the stubs. 我建议您从零开始重建所有项目,然后重新部署它们,并重新生成存根。

Looks like your server has a different version of the object that your client. 看起来您的服务器具有与客户端不同的对象版本。 Make sure they are both using the same code for the com.afrikbrain.util.message.MessageInfo object. 确保它们都为com.afrikbrain.util.message.MessageInfo对象使用相同的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM