File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Dynamic downloading of stubs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Dynamic downloading of stubs" Watch "Dynamic downloading of stubs" New topic

Dynamic downloading of stubs

Narayan Veeramani

Joined: Jun 06, 2001
Posts: 25
Is anyone downloading the server stub from the server machine.
I am running into unmarshal exception and it is unable
to find the stub classes.
When I have the stubs on the client side, it runs fine.
I am setting the java.rmi.server.codebase property, unless
I am doing it the wrong way. Further it seems to be able to
locate the policy file. Has any one run
into similar problems.
[This message has been edited by Narayan Veeramani (edited July 11, 2001).]
Doug Melzer
Ranch Hand

Joined: Mar 23, 2000
Posts: 51
Ensure that when you start the rmiregistry you do so such that its classpath is undefined.
Akanimo Udoh
Ranch Hand

Joined: Jun 11, 2001
Posts: 48
Here are a few checkpoints to pinpoint possible sources of error:
1.) Ensure that the java.rmi.server.codebase property is set in the command line for the SERVER (not needed in the CLIENT). On a windows machine it must take the following form:
(note the tripple '/' after file ) In the example above i used executable jar files if you're using the raw files in directories then you SHOULDN'T just put the directory in which the file is located. Rather specify the directory off which it can be found using the full class specifier (e.g. if suncertify.server.RemoteServer is in directory c:/scdj/src/suncertify/server then specify c:/scdj/src as the codebase)
2.) Generatae stubs and ensure that the stub classes are in the same directory as the UnicastRemoteObject class when you run the server.
3.) Make sure the class files above are within the CLASSPATH of the server and not in the class path of the client.( You can save yourself a lot of problems with CLASSPATH's if you stick to using executable jar files)
If the only error you're getting is what you've mentioned then these will correct that error. If you haven't properly defined the policy file then you'll probably get some new security exceptions.
Hope this will help.
[This message has been edited by Akanimo Udoh (edited July 12, 2001).]
Narayan Veeramani

Joined: Jun 06, 2001
Posts: 25
Thanks Akanimo and Doug for your feedback. I am planning on making these changes and see whether it works.
I agree. Here's the link:
subject: Dynamic downloading of stubs
It's not a secret anymore!