logo       

Re: How to get the stub in the jar file?: msg#00013

java.sun.rmi

Subject: Re: How to get the stub in the jar file?

> Someone has asked this before, but no replies. Here it goes again. My RMI
> program can't find the stub in the test.jar file. It throws the error below
> when it tries does the naming bind. How do I tell the program to look for
> the stub in the jar?
>
> I invoke my application with:
>
> java -classpath "test.jar" pack.main
>
> My test.jar has the following structure:
>
> test.jar
> + pack
> - main.class
> + others
> - remote_Stub.class
>
> Error printout:
> java.rmi.ServerException: RemoteException occurred in server thread; nested
> exception is:
> java.rmi.UnmarshalException: error unmarshalling arguments; nested
> exception is:
> java.lang.ClassNotFoundException: pack.others.remote_Stub

This exception indicates that it's the registry that is unable to load
the stub class, not your main program. Either the stub class must be
made available for dynamic class loading[*], or it must be in the
registry VM's class path.

-- Peter

[*] For doing that, these links might be helpful:

http://java.sun.com/j2se/1.3/docs/guide/rmi/codebase.html
http://java.sun.com/docs/books/tutorial/rmi/index.html

===========================================================================
To unsubscribe, send email to listserv@xxxxxxxxxxxx and include in the body
of the message "signoff RMI-USERS". For general help, send email to
listserv@xxxxxxxxxxxx and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise