Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UnmarshalException:error unmarshalling return;nested exception ClassNotFoun

843793May 27 2009 — edited Jan 13 2010
Hi,
I have written a client for an enterprise application. The client communicates with the application using APIs provided by the application that internally make RMI calls to the application server.

I am getting the following error when the client invokes a remote method.
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
    java.lang.ClassNotFoundException: <a.b.c.MyClass>
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:169)
The class 'a.b.c.MyClass' is included in the client JAR as well as in the server installation directory. The classes in this directory will be added by server into its classpath automatically. The client and server are running on the same machine but have different classpaths.

The remote method uses class 'a.b.c.MyClass' in both input parameter and return type.
This method returns a list of objects found as specified by the input parameters. The input parameter and the result both use the 'a.b.c.MyClass'.

The code is able to make the call, the server processes the call, but it is failing wihle returning the result. I am not able to understand why it is failing for Unmarshalling the class that it has already (marshalled) used while sending the input parameters.

The code was working fine previously. I am not able to find out what has made it not working.

Waiting for your valuable help.

Providing the complete stack trace for reference
	
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
    java.lang.ClassNotFoundException: <package.class>
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:169)
    at wt.method.MethodServerImpl_Stub.invoke(Unknown Source)
    at wt.method.RemoteMethodServer.invoke(RemoteMethodServer.java:616)
    at wt.fc.PersistenceManagerFwd.find(PersistenceManagerFwd.java:215)
    at ... Client call stack
    at AppSide_Connector.BusObjJavaInterface.poll(BusObjJavaInterface.java:584)
    at AppSide_Connector.AppCalls.poll(AppCalls.java:192)
    at AppSide_Connector.AgentBusinessObjectManager.poll(AgentBusinessObjectManager.java:717)
    at AppSide_Connector.AppPolling.poll(AppPolling.java:310)
    at AppSide_Connector.AppPolling.doPollingContinuousWait(AppPolling.java:574)
    at AppSide_Connector.AppPolling.run(AppPolling.java:137)
    at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassNotFoundException: <package.class>

    at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:219)
    at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:558)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
    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 wt.fc.QueryResult$ChunkedExternalization.readObject(QueryResult.java:449)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
    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 wt.fc.QueryResult.readExternal(QueryResult.java:156)
    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 wt.method.MethodResult.readExternal(MethodResult.java:144)
    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 sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:297)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:146)
    ... 15 more
Regards,
jsk1
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2010
Added on May 27 2009
2 comments
1,937 views