Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic