4 Replies Latest reply: Aug 1, 2010 11:28 PM by 843793 RSS

    java.rmi.UnmarshalException

    843793
      I have created an object Person of type Serializable and bind to jndi service provided by weblogic by using the following code
      Person p1=new Person();
      c.rebind("class/girls/name2",p1);
      how ever i am getting java.rmi.UnmarshalException when i run the program

      how ever the following code is working fine on my system
      c.rebind("class/girls/name2,"chow");

      when i try to bind a serializable object like a Person that i have created i am getting UnmarshalException
        • 1. Re: java.rmi.UnmarshalException
          EJP
          Post the complete stack trace please.

          And the 'following code' isn't working, because it doesn't even compile.
          • 2. Re: java.rmi.UnmarshalException
            843793
            Exception in thread "main" javax.naming.CommunicationException. Root exception is java.rmi.UnmarshalException: error unmarsh
            alling arguments; nested exception is:
            java.io.StreamCorruptedException
            at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
            at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
            at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
            at weblogic.jndi.internal.ServerNamingNode_812_WLStub.rebind(Unknown Source)
            at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:137)
            at javax.naming.InitialContext.rebind(Unknown Source)
            at JndiTree_Bind_Object.main(JndiTree_Bind_Object.java:185)
            Caused by: java.io.StreamCorruptedException
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1506)
            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 weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:119)
            at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:112)
            at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
            at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
            at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
            • 3. Re: java.rmi.UnmarshalException
              EJP
              Is your Person class an exported remote object?

              Does it implement any of readObject(), writeObject(), readResolve(), or writeReplace()? If so how? and why?
              • 4. Re: java.rmi.UnmarshalException
                843793
                i got the solution.Weblogic requires the Person class in its class path to deserialize the serialized object.