Serialize Swing Document - java.io.InvalidClassException
Hi,
I'm tryin to serialize a javax.swing.text.Document from a JTextPane (DefaultStyledDocument). This works without problems and I can deserialize it in the same app.
Unfortunately I'm getting the following error if I try to deserialize it with another app.
java.io.InvalidClassException: javax.swing.text.DefaultStyledDocument; local class incompatible: stream classdesc serialVersionUID = 940485415728594881, local class serialVersionUID = 940485415728614849The UIDs are always the same above. The data was transmitted over network. The data is valid, both byte arrays in both apps have the same Hash.
Any help appreciated! :-)
Best Regards,
Stephen
Problem solved!
It was java.lang.String fault!
I converted the byte[] array of the serialized object to a String.
String str = new String( bytearray );and back.
byte[] array = str.getBytes();Data was corrupted when the String was constructed from the byte array. It is not possible to convert the byte[] array of a serialized object to a string using String() constructor!
You have to en/decode it with base 64!
Similar Messages
-
Applet/Servlet --java.io.InvalidClassException
I'm trying to get an Applet to send data to a servlet and vice versa but I come upon this error:
java.io.InvalidClassException: javax.swing.AbstractButton; Local class not compatible:
stream classdesc serialVersionUID=-937921345538462020
local class serialVersionUID=7577615732708390153I know the client version is 1.4.1 and the server is 1.3. However, It is not fair to ask every client to make sure they have 1.3, or to have to upgrade the server to 1.4.1.
Isn't there a way to make them compatible? I heard about the serialVer program that comes with JAVA but I don't know how to use it to solve my problem.
Thanks1. You should not try to send serialized Swing objects between different Java versions. Almost every of them has the following notice in their JavaDoc:
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
In 1.4 you may use XML-based persistence (see XMLEncoder).
2. SerialVer is a good program, but even if you mark two classes as compatible (by assigning an explicit serialVersionUID), they should indeed be compatible. Look for specs on serialization available within the JDK Documentation bundle.
3. Core JDK classes (java.util, java.lang), as far as I remember, are compatible and can be read / written by different JDKs.
4. If you would pass your own classes through serialization from 1.3 to 1.4 or back, you probably should provide some explicit serialVersionUID for them. The reason is that 1.4 in some cases may calculate a different value than 1.3, for the same class. Look around for a list of changes between that versions. -
Hi,
I am running JAXB 1.0 (JWSDP 1.1) with Weblogic 6.1 Below is the code that is causing the exception. Inspite of the error JAXB reads the XML in fine and everything proceeds normally. Any help would be greatly appreciated.
Thanks in advance,
Abhijit
JAXBContext jc = JAXBContext.newInstance("my.package");
// create an Unmarshaller
Unmarshaller u = jc.createUnmarshaller();
// enable validation
u.setValidating( true );
// unmarshal an instance document into a tree of Java content
ProductsType prods = (ProductsType)u.unmarshal(new FileInputStream( "products.xml" ) );
The last line above causes the following error
java.io.InvalidClassException: com.sun.msv.grammar.trex.TREXGrammar; Local class
not compatible: stream classdesc serialVersionUID=7316616993473479596 local cla
ss serialVersionUID=1
at java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:5
18)
at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:562)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java
:931)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at com.sun.xml.bind.GrammarInfo.getGrammar(GrammarInfo.java:63)
at com.sun.xml.bind.GrammarInfoFacade.getGrammar(GrammarInfoFacade.java:
129)
at com.sun.xml.bind.DefaultJAXBContextImpl.getGrammar(DefaultJAXBContext
Impl.java:76)
at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.createUnmarshallerHand
ler(UnmarshallerImpl.java:98)
at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(Unmarshaller
Impl.java:112)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnm
arshallerImpl.java:139)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnm
arshallerImpl.java:186)
at com.manu.tp.product.ProductInputSessionBean.bindXmlDocument(ProductIn
putSessionBean.java:98)
at com.manu.tp.product.ProductInputSessionBean.processProducts(ProductIn
putSessionBean.java:31)
at com.manu.tp.product.ProductInputSessionBean_j5odob_EOImpl.processProd
ucts(ProductInputSessionBean_j5odob_EOImpl.java:1393)
at com.manu.tp.product.ProductInputSessionBean_j5odob_EOImpl_WLSkel.invo
ke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:274)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- linked to ------------------
javax.xml.bind.JAXBException: unable to extract the schema information
- with linked exception:
[java.io.InvalidClassException: com.sun.msv.grammar.trex.TREXGrammar; Local class not compatible: stream classdesc serialVersionUID=7316616993473479596 local cl
ass serialVersionUID=1]
at com.sun.xml.bind.GrammarInfo.getGrammar(GrammarInfo.java:70)
at com.sun.xml.bind.GrammarInfoFacade.getGrammar(GrammarInfoFacade.java:
129)
at com.sun.xml.bind.DefaultJAXBContextImpl.getGrammar(DefaultJAXBContext
Impl.java:76)
at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.createUnmarshallerHand
ler(UnmarshallerImpl.java:98)
at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(Unmarshaller
Impl.java:112)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnm
arshallerImpl.java:139)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnm
arshallerImpl.java:186)
at com.manu.tp.product.ProductInputSessionBean.bindXmlDocument(ProductIn
putSessionBean.java:98)
at com.manu.tp.product.ProductInputSessionBean.processProducts(ProductIn
putSessionBean.java:31)
at com.manu.tp.product.ProductInputSessionBean_j5odob_EOImpl.processProd
ucts(ProductInputSessionBean_j5odob_EOImpl.java:1393)
at com.manu.tp.product.ProductInputSessionBean_j5odob_EOImpl_WLSkel.invo
ke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:274)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)java.io.InvalidClassException: com.sun.msv.grammar.trex.TREXGrammar; >Local class not compatible: stream classdesc
serialVersionUID=7316616993473479596 local class serialVersionUID=1This is the problem. Basically this tells that the class on the receiving end (the local class) and the one that was serialized to the stream are different versions. Every class is assigned a serialVersionUID when it's compiled, and if two classes that are otherwise the same have different serialVersionUIDs, they are considered to be different versions and the above exception is raised.
You should check that the JAR files on both VMs are exactly the same versions.
What's worrying is the UID of the local class, 1. This doesn't look like something that was automatically generated by the compiler but more like that somebody explicitly defined a serialVersionUID field when trying to avoid class incompatibility issues and initialized it to the value of 1. This is indeed extremely bad programming practice and should not be used.
.P. -
Could not deserialize session data, java.io.InvalidClassException
Whenever I click on logout link from Liferay(Which deployed as application on Weblogic 10.3),It shows below Exception in the console however i am able to logout sucessfully.
Could not deserialize session data.
java.io.InvalidClassException: org.hibernate.proxy.pojo.javassist.SerializableProxy; local class incompatible: stream classdesc serialVersionUID = 1180036893511205383, local class serialVersionUID = -2265249369383210104 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:560)
It seems to be Classpath polluted with different hibernate jars.But still not able to figure it out.Below is the jar files which i have in classpath.
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate3.jar
Application Server: Weblogic 10.3
Any Help would be much appreciated.Sounds like you have two different versions of a class in the two applications.
If you change a class implementation and recompile - the updated class gets a new UID. Looks like maybe one app has a jar with the older class and the other app has a jar with the new class. -
Java.io.InvalidClassException
Hello,
I have tomcat running the JSP files for an online application. The error messages I am getting when I try to open a particular jsp file (summary_detail.jsp) is written in the log file of the application, and is as follows:
ERR summary_detail.jsp: java.io.InvalidClassException: com.icwjsp.summary.java.DataSubObjectItem; Local class not compatible: stream classdesc serialVersionUID=-8981327278361376304 local class serialVersionUID=-4077089632444832393
CALLSTACK com.inqmy.services.rmi_p4.P4RuntimeException: java.io.InvalidClassException: com.icwjsp.summary.java.DataSubObjectItem; Local class not compatible: stream classdesc serialVersionUID=-8981327278361376304 local class serialVersionUID=-4077089632444832393
at com.icwapi.apiobjects.MedicalOverview_Stub.getData(MedicalOverview_Stub.java:375)
at com.icwapi.apiobjects.MedicalOverviewKey.getData(MedicalOverviewKey.java:10)
at summary.main.health.summary_detail_1._jspService(summary_detail_1.java:190)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Ajp13Interceptor.processConnection(Ajp13Interceptor.java:341)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:484)
Any help on what could be leading to the problem (o.k. local class not compatible), or even better still, any pointers to what I could do to fix the problem, would be very much appreciated!
Thank you,Thanks for answering, no it wasn't!
I was sure it was, cos I have it running on my local machine, but there was a cache that I needed to clear.
Cheers! -
Hi
Program is giving unpredictable behaviour.
Am trying to consume webservice using Axis Client.
When running as stand alone Java programs its working fine.
But when deployed on OC4J its giving problem
Error processing WSDL document: java.lang.ClassCastException: java.util.ArrayList
Could you please give some hint
Regards
BajarangHere is the program
QName serviceQN = new QName(targetNamespace,serviceName );
System.out.println("After serviceQN "+ serviceQN);
QName portQN = new QName( targetNamespace, portName );
System.out.println("After port "+ portQN);
// This Call object will be used the invocation
Service service = new Service(implURI,serviceQN);
System.out.println("After service "+ service);
Call call = (Call) service.createCall();
System.out.println("After call "+ call);
// Now make the call...
System.out.println("Invoking service>> " + serviceName + " <<...");
call.setOperation(portQN,operationName);
call.invoke( inputParams );
System.out.println("Result returned from call to "+ serviceName+" ");
Error while execution
javax.xml.rpc.ServiceException: Error processing WSDL document:
java.lang.ClassCastException: java.util.ArrayList -
version: 1.6.0-beta2-b86
I want to call a remote method using RMI to pass back a serialized Remote object that is composed of two SynchronousQueue objects. The exception that I get when I call the method is below.
Client exception: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.InvalidClassException: java.util.concurrent.SynchronousQueue$WaitQueue; local class incompatible: stream classdesc seria
lVersionUID = 4403964863567356358, local class serialVersionUID = -858510627080488182
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.InvalidClassException: java.util.concurrent.SynchronousQueue$WaitQueue; local class incompatible: stream classdesc seria
lVersionUID = 4403964863567356358, local class serialVersionUID = -858510627080488182
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
at $Proxy0.register(Unknown Source)
at ExchangeClient.main(ExchangeClient.java:30)
Caused by: java.io.InvalidClassException: java.util.concurrent.SynchronousQueue$WaitQueue; local class incompatible: stream classdesc se
rialVersionUID = 4403964863567356358, local class serialVersionUID = -858510627080488182
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.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
at java.util.concurrent.SynchronousQueue.readObject(SynchronousQueue.java:1120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:589)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155hi,
is this j2ee application ur trying to deploy on app server?
if so u could try re-deploying ur application and check ur settings again..datasources etc , see to it that u hv given rite and correct values for jdbc drivers,jdbc url,check java classes used,DS etc for the j2ee app in ur EM website.
or try re-starting that oc4j component that was used , maybe this could help.god bless:)
Edited by: lillyak on Mar 16, 2009 11:58 PM -
Java.io.InvalidClassException in WebLogic
When I use weblogic 8.1 JMS SERVICE,I encounter a problem.
Sample code like:
Properties p=new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context context=new InitialContext(p);
System.out.println("search for the connecton factory...");
QueueConnectionFactory factory=(QueueConnectionFactory)context.lookup("weblogic.jms.ConnectionFactory");
System.out.println("get it!");
System.out.println("to get queueconnection...");
QueueConnection con=factory.createQueueConnection();
System.out.println("get it!");
System.out.println("to get queue session...");
QueueSession session=con.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
System.out.println("get it!");
System.out.println("search for the messagequeue...");
Queue messageQueue=(Queue)context.lookup("HelloQueue");
System.out.println("get it!");
System.out.println("to get the queue sender...");
QueueSender sender=session.createSender(messageQueue);
System.out.println("get it!");
con.start();
TextMessage message=session.createTextMessage();
message.setText("HelloSenderQueue!");
sender.send(message);
Main Exception like:
<BEA-000503> <Incoming message header or abbreviation processing failed
[java] java.io.InvalidClassException: weblogic.jms.common.DestinationImpl; local class incompatible: stream classdesc serialVersionUID = 6099783323740404732, local class serialVersionUID = -7124492888158518181
[java] java.io.InvalidClassException: weblogic.jms.common.DestinationImpl; local class incompatible: stream classdesc serialVersionUID = 6099783323740404732, local class serialVersionUID = -7124492888158518181
[java] at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
[java] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
[java] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
[java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
[java] at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:33)
[java] at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
[java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
[java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
[java] at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
[java] at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
[java] at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:209)
[java] at weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.java:227)
[java] at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:733)
[java] at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:570)
[java] at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:681)
[java] at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:617)
[java] at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:282)
[java] at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
[java] at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
[java] at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[java] >
[java] <2004-10-3 上午12时11分52秒 CST> <Error> <RJVM> <BEA-000503> <Incoming message header or abbreviation processing failed
[java] java.io.InvalidClassException: weblogic.jms.common.DestinationImpl; local class incompatible: stream classdesc serialVersionUID = 6099783323740404732, local class serialVersionUID = -7124492888158518181
[java] java.io.InvalidClassException: weblogic.jms.common.DestinationImpl; local class incompatible: stream classdesc serialVersionUID = 6099783323740404732, local class serialVersionUID = -7124492888158518181
[java] at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
[java] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
[java] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
[java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
[java] at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:33)
[java] at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
[java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
[java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
[java] at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
[java] at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
[java] at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:209)
[java] at weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.java:227)
[java] at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:733)
[java] at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:570)
[java] at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:681)
[java] at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:617)
[java] at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:282)
[java] at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
[java] at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
[java] at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[java] >The InvalidClassException is not a JMS problem, but I'll try and answer anyway.
this exception is thrown when you try to unmarshall (deserialize) an object that you received from a remote location, such as an RMI server, or JNDI. The specific reason you have (serialVersionUID) indicates that the version of the class in question (weblogic.jms.common.DestinationImpl) is different between the two participating JVMs.
This is usually a classpath problem, or - sometimes it's a matter of having two installations of weblogic on your computer (i.e. - trying to get from 8.1 to 7).
Make sure that you have the correct jar in your classpath.
nimo. -
Java.io.InvalidClassException:local class incompatible?
hello everyone:
I deploy a J2EE application called A in a weblogic domain called A, it can run correctly;
then I deploy another J2EE application called B, which is a new edition of A, in another weblogic domain called B, it can also run correctly;
The two domains use the same server. I don't know whether this will cause problems like this.
But the previous A can't run correctly and throw exceptions as follows in Java Console:
java.io.InvalidClassException: com.longzhou.oa.docnet.dto.abstractdto.DnBaseRole; local class incompatible: stream classdesc serialVersionUID = 1264764439065723117, local class serialVersionUID = -6834466395328850197
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at com.longzhou.oa.applet.util.EjbLocator.getInputStream(EjbLocator.java:18)
at com.longzhou.oa.applet.DnIO.getDnAllByID(DnIO.java:63)
at com.longzhou.oa.applet.DnIO.loadGraph(DnIO.java:33)
at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:185)
at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
at org.enhydra.jawe.JaWE.init(JaWE.java:195)
at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.longzhou.oa.applet.DnIO.getDnFromDto(DnIO.java:731)
at com.longzhou.oa.applet.DnIO.loadGraph(DnIO.java:34)
at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:185)
at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
at org.enhydra.jawe.JaWE.init(JaWE.java:195)
at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Object
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at com.longzhou.oa.applet.util.EjbLocator.getInputStream(EjbLocator.java:18)
at com.longzhou.oa.applet.InitModel.initEmpGroupList(InitModel.java:353)
at org.enhydra.jawe.DnDefine._$1(Unknown Source:241)
at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:186)
at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
at org.enhydra.jawe.JaWE.init(JaWE.java:195)
at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.NotSerializableException: java.lang.Object
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at com.longzhou.oa.util.EgovServlet.service(EgovServlet.java:332)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
at java.lang.Thread.startThreadFromVM(Unknown Source)
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Object
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at com.longzhou.oa.applet.util.EjbLocator.getInputStream(EjbLocator.java:18)
at com.longzhou.oa.applet.InitModel.initSysRoleList(InitModel.java:371)
at org.enhydra.jawe.DnDefine._$1(Unknown Source:242)
at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:186)
at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
at org.enhydra.jawe.JaWE.init(JaWE.java:195)
at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.NotSerializableException: java.lang.Object
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at com.longzhou.oa.util.EgovServlet.service(EgovServlet.java:332)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
at java.lang.Thread.startThreadFromVM(Unknown Source)
Can anyone tell me the reason? Thanks"local class incompatible" error is due to the retrieving of serialized object, which might be dumping from memory to somewhere like database, file etc., that is of different edition of the class. Maybe an object A of AClass was stored in a database and lately the AClass changed to a new edition, let's call it A'Class, and they have something different, especially the serialVersionUID field. When the object A is retrieved from the database, which should be compatible with A'Class (be ware of that A'Class and AClass has the same name but of different edition), unfortunately, they don't, the error mentioned above occurs.
So, I guess that although the app A and B uses different domain, if they uses the same database to store and retrieve something (here may refers to objects) of different edition and are run one after another, the compatible issues are going to occur.
Separating app A from B as much as possible is not a good solution, but you could have a try.
Hoping helpful, good luck! -
Hi there,
I'm working on a JSP running on a Tomcat server 4.0.1. Such JSP calls a Servlet, which tries to recover an EJB:
public CommunityEJB getCommunityEJB() throws UnexpectedException
CommunityEJB lRet = null;
CommunityEJBHome lhome = null;
Context jndiContext = null;
try
lhome = (CommunityEJBHome) ServiceLocator.getInstance().getEJBHome(JNDINames.EJB_COMMUNITY);
lRet = lhome.create();
catch (Exception e)
UnexpectedException ue = new UnexpectedException(e);
logger.throwing(CLASS_NAME, "getCommunityEJB", ue);
throw ue;
return lRet;
The EJB is recovered though JNDI, running on JBoss 3.2.1. Tomcat server and JBoss are running separately (Tomcat I'm using is not the embedded in JBoss).
The code above throws the next exception:
tuamo.core.exception.UnexpectedException: javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.proxy.Interceptor; local class incompatible: stream classdesc serialVersionUID = 4358098404672505200, local class serialVersionUID = 8774269974037850782]
Can anybody help me with this?
Thanks!!The EJB client jar is out of sync with the EJB server jars. In simple words, you might have recompiled any or all of the following and either only redeployed it on the server or dropped it in the client classpath depending on where did you make the changes.
home interface
remote interface
types being passed over the methods in these interfaces (parameters, return values, etc.)
I'm not quite sure what you mean by recovering an EJB? Typically its called looking it up. -
Hello im using weblogic 10.3.5 and jpa 2, but i cant make that my project works coz i have this issue....
56177847, local class serialVersionUID = -8219935847209476671 java.io.InvalidClassException: org.eclipse.persistence.internal.helper.DatabaseTable; local class incompatible: stream classdesc serialVersionUID = 740837816705
Can somebody help me please?
Thanks.Just a guess because there is so little information given but perhaps you are attempting to deserialize a class that should not have been serialized in the first place.
-
Hi,
I recently create a webservice application.
It work fine when the server is implemented as java application. But when rewritten as web application( *.war), the deploiement work on WLS.
However it throws java.io.InvalidClassException: org.eclipse.persistence.internal.indirection.DatabaseValueHolder; local class incompatible: stream classdesc serialVersionUID = -6893195210780291759, local class serialVersionUID = 1128857921468654749 error when the client start consumming the web service methods.
I add both eclipselink-javax.persistence-2.0.jar and eclipselink-2.0.2.jar(which are also used in the server side) in $WL_HOME/wlserver_10.3/common/deployable-libraries, that doesn't solve the problem yet.
Any help will be appreciated, cheers.Abenk,
This looks like a serial version mismatch due to multiple Eclipselink.jar files. Check if you have any under server/internal/ext folder.
What are you putting in your classpath? Is there a "jrf.jar" and is it getting picked up first? Does this Jrf.jar have an entry of Eclipselink jar?
Try to check the classpath of the jars used by Weblogic and remove any redundant Eclipselink/Toplink jars.
What is the complete version of your Weblogic Server ? -
Are JFC Swing and java Swing both different?
Thanks.Nope. Swing is Swing.
http://java.sun.com/docs/books/tutorial/uiswing/14start/about.html -
Document java methods/classes?
Hi!
I normally document java methods using UML sequence diagrams but was wondering whether there is a better way using xsd schemas that I can then use to create the classes. Is there any standard annotation/framework?
Thanks.
IggyAshu_Web wrote:
No please.. I just want to know if you have used it while programming. Like "an abstract class can be used to put all the common method names in it without having to write actual implementation code."That would describe an Interface better than an abstract class. Abstract classes usually have at least some implementation.
I want to know its usage in programming, not just a definition. I guess you understand what I am looking for.Yes, and I gave you one: java.util.AbstractList. It can be found inside the src.zip in your JDK directory and it is a pretty good example for an abstract class that provides some implementation and defines exactly what is necessary to make a full List implementation. -
Hello,
Getting this error on Groupware Connector :
java.io.InvalidClassException: lotus.domino.NotesException; local class incompatible
Can anyone help me with this error.
Regards,
PratimaHello,
Getting this error on Groupware Connector :
java.io.InvalidClassException: lotus.domino.NotesException; local class incompatible
Can anyone help me with this error.
Regards,
Pratima
Maybe you are looking for
-
Hi, i have a MB Pro Intel C2D with Lion OS and i migrated the user to another MB Pro i5 Lion, after migrating I'm having a problem on Safari, it won't open and just crashing
-
How do i fix windows 8.1 unknown language problem
Hello Sir, I am one of your Microsoft Users, i am using 50 licenses Windows 8.1 Professional version 64 Bit for my official use. From last six month i am facing this Issue So Kindly I'll request to you please look into this. The problem is Every time
-
IPod nano only plays a small portion of the song then skips the rest
Hey, my friend recently got a song from limewire and it works fine in iTunes, but when she plays it on her iPod, it plays like 30 seconds then it skips it....she has tried taking it off of her iPod and putting it back on, tried taking it out of iTune
-
Shuffle ****, I love it BUT...
Ok, Got a new shuffle for Christmas, Hooked it up with no problems and copied over about 50 songs just to get started. They played fine and I loved it. Next day I decided to fill it up, Windows would see the Shuffle, but ITunes never would. I tried i
-
Sharepoint 2013 installation modules
Hi All, Question - we are planning to install SP 2013 Ent. Our sysadmin is very experienced but he did not take any SP classes. He is planning to install SP 2013 Ent in regular/full configuration and then install reporting services integration mod