Meaningless Drivel is fun!*
The moose likes Distributed Java and the fly likes RMI error: java.rmi.UnmarshalException: error unmarshalling arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI error: java.rmi.UnmarshalException: error unmarshalling arguments" Watch "RMI error: java.rmi.UnmarshalException: error unmarshalling arguments" New topic
Author

RMI error: java.rmi.UnmarshalException: error unmarshalling arguments

Greg Ferrell
Greenhorn

Joined: Jan 02, 2007
Posts: 5
I am running my RMI server program in Eclipse 3.2.1 with JVM 1.5.0_07, and sending the following VM argument -Djava.rmi.server.codebase=file:/CHIP/. I get the following error when running it on my local machine.

CHIPserverImpl exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException:
I have the rmiregistry running ... I believe my codebase argument is correct. Any ideas what the problem could be?
[ January 02, 2007: Message edited by: Greg Ferrell ]
Chris Beihl
Greenhorn

Joined: Jan 02, 2007
Posts: 4
Usually that error comes up when one of the VMs cannot find a class it needs to unmarshall the serialized data. Are you running both VMs on the same machine? If not, you probably don't want to use a CODEBASE with a file URI.

RMI looks in the VM classpath first then checks the CODEBASE.

Double check the runtime classpaths for both VMs and make sure that all the classes you pass between the two VMs are present ( don't forget classes that are referenced inside other classes ).
Greg Ferrell
Greenhorn

Joined: Jan 02, 2007
Posts: 5
Usually that error comes up when one of the VMs cannot find a class it needs to unmarshall the serialized data. Are you running both VMs on the same machine? If not, you probably don't want to use a CODEBASE with a file URI.

RMI looks in the VM classpath first then checks the CODEBASE.

Double check the runtime classpaths for both VMs and make sure that all the classes you pass between the two VMs are present ( don't forget classes that are referenced inside other classes ).


I am running the VMs on the same machine for testing purposes as of now. How can I check the runtime classpath for the VM? I'm not sure exactly how Eclipse builds this based on my settings, but another guy is getting the example working, and he has his environment setup the same way I do, with the same VM argument.
Chris Beihl
Greenhorn

Joined: Jan 02, 2007
Posts: 4
To find out your classpath of the run profile you launched :

1. pull up the run dialog ( Run -> Run... )
2. click on the run profile you are using
3. click the Classpath tab
4. look under User entries

Good luck
Greg Ferrell
Greenhorn

Joined: Jan 02, 2007
Posts: 5
Thanks for the replies.

Turns out I had the codebase (-Djava.rmi.server.codebase) attribute set incorrectly ... Maybe I shouldn't be diving into Java/Eclipse & RMI all at the same time
Greg Ferrell
Greenhorn

Joined: Jan 02, 2007
Posts: 5
Apparently, there�s some magic going on behind the scenes in Eclipse that I simply do not understand.

After I got this working the other day, I was changing around the build path a bit (adding & removing some source directories and libraries) and this stopped working AGAIN with the exact same error.

I eventually solved the problem AGAIN by changing the codebase argument from:
-Djava.rmi.server.codebase=file:/java/bin/ to
-Djava.rmi.server.codebase=file:k:/java/bin/

All I did is put the complete path to the default output folder in Eclipse (k:/java/bin) instead of java/bin

Does anyone have any idea why this would have changed? My .project & .classpath files are in k:/java and that's where the root of the project exists.

TIA!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI error: java.rmi.UnmarshalException: error unmarshalling arguments