java.rmi.MarshalException

白昼怎懂夜的黑 提交于 2019-12-02 16:26:53

问题


whenever I try to call my ejb from a client, I get this error :

  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 ?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/1578434/java-rmi-marshalexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!