Remote client and EJB
eldiosyeldiablo Jan 28, 2005 8:46 PMI am unable to call my Statefull Session from a remote client.
I am using the javax.naming.Context.lookup() method to get the EJBHome object. However when I execute the lookup method I get the exception thrown at the bottom of this posting. The exception thrown is java.io.InvalidClassException.
My research on this forum and google searches indicates that this may be an issue with compiling the code for the EJB Session on the Server and the client. However, that is not the case for me. I am compiling the EJB code only once and then that compiled class is used both by the client and JBoss.
Another suggestion was that it could be worked around by putting a "private static final long serialVersionUID" variable in the class. This did not fix the problem either.
The code will work on JBoss 4.0.0DR4.
It will not not work on JBoss 4.0.1
javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.util.id.GUID; local class incompatible: stream classdesc serialVersionUID = 3289509836244263718, local class serialVersionUID = 6926421946503004889] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520) at javax.naming.InitialContext.lookup(InitialContext.java:347) at com.relevant.util.JNDIServiceLocator.getService(JNDIServiceLocator.java:95) at com.relevant.BizWiz.BizWiz.getServerConnection(BizWiz.java:113) at com.relevant.BizWiz.BizWiz.<init>(BizWiz.java:76) at com.relevant.BizWiz.BizWiz.mainFrame(BizWiz.java:146) at com.relevant.BizWiz.BizWiz.access$000(BizWiz.java:44) at com.relevant.BizWiz.BizWiz$3.run(BizWiz.java:241) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178) at java.awt.EventQueue.dispatchEvent(EventQueue.java:454) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137) at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) Caused by: java.io.InvalidClassException: org.jboss.util.id.GUID; local class incompatible: stream classdesc serialVersionUID = 3289509836244263718, local class serialVersionUID = 6926421946503004889 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.jboss.invocation.InvokerInterceptor.readExternal(InvokerInterceptor.java:190) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:66) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:66) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:66) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:147) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at java.rmi.MarshalledObject.get(MarshalledObject.java:135) at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:51) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:566) ... 15 more
Any suggestions are greatly appreciated.
-David
Relevant Business Systems