2 Replies Latest reply on Mar 12, 2002 8:09 AM by sbpyari

    Problem while accesing remote methods

    sbpyari

      Hi guys,
      I created some beans(sesion and entity(CMP & BMP)) and deployed successfully in Orcale9ias.. Now i am porting it to jboss. i am finding some problem.. I dont know where i did mistake.. Pl i need ur valuable suggestion on this.
      The problem what i am facing is
      I deployed one CMP bean in jboss .. i wrote some finder methods in jaws.xml etc. The problem is, i am able to access the finder methods and it is returning the collection perfectly. When i get the bean from the collection and if i access any remote methods i am getting an exception in client side as
      The Stack follows

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: Load failed; nested exception is:
      java.lang.NullPointerException

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: Load failed; nested exception is:
      java.lang.NullPointerException

      java.rmi.ServerException: Load failed; nested exception is:
      java.lang.NullPointerException

      java.lang.NullPointerException

      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)

      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)

      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)

      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown Source)

      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:357)

      at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:133)

      at $Proxy1.getJobid(Unknown Source)

      at Client.main(Client.java:70)


      Before that i wld like to say a problem while deploying .i am getting a warning like this

      Section: 9.4.7.1
      Warning: The type of the field named in the primkey-field element must match the class in the prim-key-class element.
      My primaykey type is "int" and i set the the primary-key-class tag to Integer.. is there any problem in this ??

      Pls let me know what is the problem.. in the server side i didnt get any exception ..


      Now the second Problem in BMP

      here while accessing the remote methods i am getting an exception as


      java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
      java.io.InvalidClassException: javax.ejb.EJBException; Local class not compatible: stream classdesc serialVersionUID=796770993296843510 local class serialVersionUID=-9219910240172116449

      java.io.InvalidClassException: javax.ejb.EJBException; Local class not compatible: stream classdesc serialVersionUID=796770993296843510 local class serialVersionUID=-9219910240172116449

      at java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:523)

      at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)

      at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)

      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)

      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)

      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)

      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)

      at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263)

      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)

      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412)

      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)

      at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263)

      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)

      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412)

      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)

      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)

      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:212)

      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)

      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown Source)

      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:357)

      at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:133)

      at $Proxy1.getJobData(Unknown Source)

      at Client.main(Client.java:53)

      I am using the smae interface there is no difference in their vesrion.. i checked throughly regarding the remote,home interface.. Is there any other interface may create the problem.. Pls Let me know abt the details as early as possible..

      I tried so many times and i am very much tired now..

      with regard
      Pyari

        • 1. Re: Problem while accesing remote methods
          pazu

          Lot's of things here. I'll try to help you a little. First, primary keys can't be primitive types. I'm not sure if it's clear in the scecification, but it says that:

          10.6.13)
          The class (the primary key class) must provide suitable implementation of the hashCode() and equals(Object other) methods to simplify the management of the primary keys by the Container.

          Primitives don't have methods, so they can't be primary key classes. Wrap your PK in a java.lang.Integer. This may be causing your first error.

          I'm not sure about the second, however. Perhaps folks dealing more deeply with persistence may help you. By the way, please tell us what JBoss version are you using. If you're using 3.0.0 from CVS, state the date of the last update.

          • 2. Re: Problem while accesing remote methods
            sbpyari

            Hi ..
            I am using JBoss2.4.4 the stable version mentioned in the site.
            As u mentioned the Primary Key should not be in primitive type. But i tested the same in Orcale9ias it is working fine. and i did the same test in Jboss too .. cos i doubted that. but it went fine with that test.

            I dont know what might be the reason regarding this.
            Thanks for ur help and expecting more regarding this
            bye
            with regards
            Pyari