ValidationException类版本不匹配

时间:2010-06-02 15:42:26

标签: java java-ee ejb-3.0 weblogic

我有一个简单的EJB应用程序,我可以在本地WebLogic实例(v10.3.0.0)上进行部署和测试而不会出现问题。我需要在远程WL服务器(v10.3.3.0)上部署它,并从本地计算机进行测试。部署成功,但是当我尝试从JDeveloper运行任何客户端时,我收到此错误:

<2010.06.02. 16:08:36 CEST> <Error> <RJVM> <BEA-000503> <Incoming message header or abbreviation processing failed
 java.io.InvalidClassException: org.eclipse.persistence.exceptions.ValidationException; local class incompatible: stream classdesc serialVersionUID = 3793659634176227230, local class serialVersionUID = -7605463488982202416
java.io.InvalidClassException: org.eclipse.persistence.exceptions.ValidationException; local class incompatible: stream classdesc serialVersionUID = 3793659634176227230, local class serialVersionUID = -7605463488982202416
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:36)
    at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
    at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
    at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:227)
    at weblogic.rjvm.MsgAbbrevInputStream.init(MsgAbbrevInputStream.java:173)
    at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:439)
    at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:322)
    at weblogic.socket.AbstractMuxableSocket.dispatch(AbstractMuxableSocket.java:394)
    at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:917)
    at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:849)
    at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:283)
    at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
    at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)

任何人都可以解释为什么我会收到此错误,以及我可以做些什么来解决它?

1 个答案:

答案 0 :(得分:0)

你有两个版本的类,可能是两个不同的JAR:s。由于Java EE经常使用类加载器层次结构,因此可能会发生一段代码从一个类加载器加载一个类,而另一段代码从另一个类加载器加载它。这两个类(具有相同名称)的实例不被认为是相同的,即使它们具有相同的serialVersionId。

您所看到的是两个不同的ValidationException实例,从不同的类实例化,从不同的类加载器(可能来自不同的JAR)加载。 JDeveloper可能包含自己的版本,与WebLogic版本冲突。您是否在应用程序中包含了eclipse验证jar?