Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Unmarshall exception

Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am trying to get a basic RMI example working and I am having a problem dealing with the rmiregistry....

when I execute the rmiregistry and try to run my server I get the following error:
$ java MyRemoteImpl
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: MyRemoteImpl_Stub
at sun.rmi.server.UnicastServerRef.oldDispatch(
at sun.rmi.server.UnicastServerRef.dispatch(
at sun.rmi.transport.Transport$
at Method)
at sun.rmi.transport.Transport.serviceCall(
at sun.rmi.transport.tcp.TCPTransport.handleMessages(
at sun.rmi.transport.tcp.TCPTransport$
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(
at sun.rmi.transport.StreamRemoteCall.executeCall(
at sun.rmi.server.UnicastRef.invoke(
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at MyRemoteImpl.main(

However, when I change the server to create a registry and bypass the rmiregistry program, it works fine...

Can anyone tell me what the problem is?

Richard Thatch
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, I did some searching and did find the answer to my question....

it seems that the stub files have to be visible to rmiregistry.

so if you run rmiregistry out of the class area for your app, that will work.
if you put the jar into the classpath, that would work as well...

another question though....

is it possible to have a directory where you put jar files such that all the jar files will be searched when needed by the JVM?

for example:

i have a ~/libs directory that contains:
lib1.jar lib2.jar lib3.jar...

can one put "~/libs" in the classpath such that the jar files will be
searched for classes automatically by the JVM ??

thanks for any help
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rmi supports dynamic class loading via a codebase over http.. that is the best way to solve your problem.. but its a bit of a tedious process to get it all set up..
it's a teeny, tiny, wafer thin ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic