5 Replies Latest reply on Dec 8, 2006 11:34 AM by Alexander Hachmann

    EJB3 Remote client problem

    RamJi thripati Newbie

      When I tried to look up for remote Session Bean(EJB3), I get the following error:


      java: org.jnp.interfaces.NamingContext@bd0108
      Looking up RemoteCalculator
      javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.stateless.StatelessRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 2583299153931800023, local class serialVersionUID = 8144530673853515126]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at trail.client.RemoteCalculatorClient.main(RemoteCalculatorClient.java:38)
      Caused by: java.io.InvalidClassException: org.jboss.ejb3.stateless.StatelessRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 2583299153931800023, local class serialVersionUID = 8144530673853515126
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:57)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:637)

        • 1. Re: EJB3 Remote client problem
          Scott Stark Master

          Its a bug in how the proxies are maintaining their serialVersionUIDs:
          http://jira.jboss.com/jira/browse/EJBTHREE-402

          You will need to have the same classes/jars on the client/server. The error indicates that you have mixed versions and are seeing the incompatibility bug.

          • 2. Re: EJB3 Remote client problem
            RamJi thripati Newbie

            I have copied the same jars from the server to the client. Still I get the error.

            Thanks

            • 3. Re: EJB3 Remote client problem
              Scott Stark Master

              You still have the out of date classes visible on the client then. Explicitly load the org.jboss.ejb3.stateless.StatelessRemoteProxy class and print out its codebase/serialVersionUID:

              import java.io.ObjectStreamClass;
              ...
               ClassLoader tcl = Thread.currentThread().getContextClassLoader();
               Class srp = tcl.loadClass("org.jboss.ejb3.stateless.StatelessRemoteProxy");
               System.out.println(srp.getProtectionDomain().getCodeSource());
               ObjectStreamClass osc = ObjectStreamClass.lookup(srp);
               System.out.println("getSerialVersionUID: "+osc.getSerialVersionUID());
              



              • 4. Re: EJB3 Remote client problem
                RamJi thripati Newbie

                Yes, You are right. The problem was jars mismatch between client and server.

                Thanks,
                Pathipati

                • 5. Re: EJB3 Remote client problem
                  Alexander Hachmann Newbie

                  Hello,
                  I am having a similar problem. But the Class that seems to be invalid is a different one. I have also copied the jars from the Server to the Client.
                  I am working with 2 JBoss Servern Version 4.0.4 GA. The one server is looking up a remote bean on the other.

                  How can i fix this ClassMissMatch when even copying the Jars does not heltp?
                  I am quiet frustrated with this problem.

                  Happy about every Help,
                  Alexander

                  17:29:02,157 ERROR [STDERR] javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible: stream classdesc serialVersionUID = -3758782076801249473, local class serialVersionUID = 595045557897063404]
                  17:29:02,158 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
                  17:29:02,158 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
                  17:29:02,158 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
                  17:29:02,158 ERROR [STDERR] at com.epgdata.axis.handlers.AuthenticationHandler._onFault(AuthenticationHandler.java:108)
                  17:29:02,158 ERROR [STDERR] at com.epgdata.axis.handlers.SessionedHandler.onFault(SessionedHandler.java:80)
                  17:29:02,158 ERROR [STDERR] at org.apache.axis.SimpleChain.onFault(SimpleChain.java:154)
                  17:29:02,159 ERROR [STDERR] at org.apache.axis.SimpleChain.onFault(SimpleChain.java:154)
                  17:29:02,159 ERROR [STDERR] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:135)
                  17:29:02,159 ERROR [STDERR] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
                  17:29:02,159 ERROR [STDERR] at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
                  17:29:02,159 ERROR [STDERR] at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
                  17:29:02,159 ERROR [STDERR] at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:708)
                  17:29:02,159 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                  17:29:02,159 ERROR [STDERR] at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
                  17:29:02,160 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  17:29:02,160 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  17:29:02,160 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  17:29:02,160 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                  17:29:02,160 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  17:29:02,160 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  17:29:02,160 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                  17:29:02,160 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                  17:29:02,160 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                  17:29:02,161 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                  17:29:02,161 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                  17:29:02,161 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                  17:29:02,161 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                  17:29:02,161 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                  17:29:02,161 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                  17:29:02,161 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                  17:29:02,161 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                  17:29:02,162 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                  17:29:02,162 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
                  17:29:02,163 ERROR [STDERR] Caused by: java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible: stream classdesc serialVersionUID = -3758782076801249473, local class serialVersionUID = 595045557897063404
                  17:29:02,163 ERROR [STDERR] at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
                  17:29:02,163 ERROR [STDERR] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
                  17:29:02,163 ERROR [STDERR] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
                  17:29:02,163 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
                  17:29:02,163 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                  17:29:02,163 ERROR [STDERR] at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
                  17:29:02,164 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
                  17:29:02,165 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                  17:29:02,165 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
                  17:29:02,165 ERROR [STDERR] at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
                  17:29:02,165 ERROR [STDERR] at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
                  17:29:02,165 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
                  17:29:02,165 ERROR [STDERR] ... 32 more