1 2 Previous Next 15 Replies Latest reply on Mar 4, 2005 4:23 AM by Mohamed Thowbick

    Remote client and EJB

    eldiosyeldiablo Newbie

      I 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

        • 1. Re: Remote client and EJB
          Darran Lofthouse Master

           

          The code will work on JBoss 4.0.0DR4.

          It will not not work on JBoss 4.0.1


          When moving to JBoss 4.0.1 are you changing the classpath of the client to use the jbossall-client.jar from 4.0.1 instead of the one from 4.4.4DR4?

          • 2. Re: Remote client and EJB
            eldiosyeldiablo Newbie

            The client and the build process is going to JBoss through a symbolic link. So when I change from 4.0.0DR4 to 4.0.1 I change the symbolic link. Just to make sure I have exited Eclipse and gone back in just to make sure that it didn't keep a file resoure open to the old JBoss location.

            So the classpath should be picking up the correct jar files.

            -David

            • 3. Re: Remote client and EJB
              Darran Lofthouse Master

               

              So the classpath should be picking up the correct jar files.


              The class that is referred to in the error is 'org.jboss.util.id.GUID', this class is contained within jbossall-client.jar. You need to be sure that you are using the correct version of the jar.

              • 4. Re: Remote client and EJB
                eldiosyeldiablo Newbie

                I just verified to make dead certain that I am grabbing the 4.0.1 version of jbossall-client.jar

                To make sure I removed the JBoss library from my Eclipse. Added the library again going to the hard location of the 4.0.1 (no symbolic link). Cleaned my build. Exited Eclipse. Go back into Eclipse. Recompile and deploy. Tried executing the code again with the same failure result. :(

                -David

                • 5. Re: Remote client and EJB
                  Franco Apprentice

                  Hi,

                  99,9% your classes server/client are not the same.
                  I think that the system cannot create serialVersionUID itself.
                  Maybe Eclipse has a cache of the old classes.

                  Try to start it with the -clean option.

                  • 6. Re: Remote client and EJB (JBoss 4.0.x)
                    Joshua Jackson Master

                    Anybody know the code for remote client if using JBoss 4?
                    I wrote the remote client to work for JBoss 3.2.x, but it can't work on JBoss 4.

                    Any inputs would be highly appreciated.
                    Thnx in advance

                    • 7. Re: Remote client and EJB
                      Darran Lofthouse Master

                      First don't hijack other peoples posts, you should be starting a new one for your question.

                      but it can't work on JBoss 4.


                      If you want any help you are going to have to explain your problem, all you have said is that it does not work. What makes you think that it is not working? What errors are you getting? What are you doing to get the errors?

                      • 8. Re: Remote client and EJB
                        Luc Vouligny Newbie

                        I have the same problem. Did you solved it?

                        • 9. Re: Remote client and EJB
                          Darran Lofthouse Master

                           

                          I have the same problem. Did you solved it?


                          Which problem do you have that is the same problem, there are two problems being discussed in this thread now.

                          • 10. Re: Remote client and EJB
                            Amit Newbie

                            Guys please use different threads for different questions/problems. To address

                            "Anybody know the code for remote client if using JBoss 4? "

                            There shouldn't be any change on client code to access EJB while migrating from 3.2.x to 4.x. I did it my self and didn't had any problems. Can you post your code, so that we can just make a sanity check?

                            • 11. Re: Remote client and EJB
                              eldiosyeldiablo Newbie

                              I just tried starting my eclipse with the -clean arguement and that did not fix the error either.

                              To futher test I removed the old jboss-4.0.0DR4 to another directory so that if my compiling or executing tasks tried to locate the old directory then I should get an error.

                              I then cleaned my project and recompiled. And I get the same error.

                              I was finally able to fix this error by doing the following steps. My test class exists in a seperate Eclipse project. This test project depends on my main project for utility classes, etc. However, for some reason even after stopping eclipse and restarting with a -clean it must have kept a reference open to the old jboss-4.0.0DR4 jar files. The way to fix this was to go to Properties->Projects and remove the checkbox for the required project. I then attempted a compile and got a compile time. I then added the required project back and was able to successfully compile and execute the test class.

                              I hope this helps anyone else that receives the serialzation error when moving from jboss-4.0.0DR4 to Jboss-4.0.1

                              • 12. Re: Remote client and EJB
                                Matthew Robinson Newbie

                                I had the problem with the incompatible class error.

                                I solved it by ensuring my client was compiled with the same version of JBOSS as the AS.

                                It seems there is an incompatibility with Serialization IDs between 4.0.0 and 4.0.1 - much the same as the one reported between 3.2.x and 4.0.x. The client that errored was compiled with 4.0.0 and was trying to access a 4.0.1 AS.

                                Nasty....

                                • 13. Re: Remote client and EJB
                                  Franco Apprentice

                                  Hi,
                                  do you have a:
                                  static serialVersionUID nnnnnnnnnnnnnnn
                                  in your bean class ?
                                  If not different compilers may generate differents uid.

                                  just for info.

                                  Ciao.

                                  • 14. Re: Remote client and EJB
                                    Stanley Lett Newbie

                                    I had same problem, was using JBoss 3.2.5 client files in JBuilder and was deploying on JBoss 4.0.0 server. Thanks for your post mrobin21.

                                    1 2 Previous Next