aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Dynamic downloading of stubs" Watch "Dynamic downloading of stubs" New topic
Author

Dynamic downloading of stubs

Narayan Veeramani
Greenhorn

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
Narayan,
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:
-Djava.rmi.server.codebase=file:///c:/ahkhan/myapp/server.jar
(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.
Akanimo.
[This message has been edited by Akanimo Udoh (edited July 12, 2001).]
Narayan Veeramani
Greenhorn

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: http://aspose.com/file-tools
 
subject: Dynamic downloading of stubs
 
Similar Threads
RMI question?
Dynamic Class Downloading Simple Question
unlock Thread
Basic RMI Question on Webserver
PASSED!!!! 152