wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Dynamic Stub Loading with file URL's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Dynamic Stub Loading with file URL Watch "Dynamic Stub Loading with file URL New topic
Author

Dynamic Stub Loading with file URL's

Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
I have trouble downloading stub class files dynamically with file URL, when I run the client on a different machine than the server. However, if I run the client and server on same machine it works fine.
I read following on Sun's web site (http://java.sun.com/products/jdk/1.2/docs/guide/rmi/codebase.html)
Like applets, the classes needed to execute remote method calls can be downloaded from "file:///" URLs, but like applets, a "file:///" URL generally requires that the client and the server reside on the same physical host, unless the file system referred to by the URL is made available using some other protocol, such as NFS.
Has anybody experienced this ? Any comments ??
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Has anybody experienced this ?

Yep. We all have, and I beleive we all decided not to use Dynamic Downloading. Youbasically need a web server for it, and you can't assume the assessor will have one.
You will need to include your stubs et al in your client jar file.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
thanks, Mark.
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
I suppose, in that case (i.e. without dynamic downloading of stub), policy file is not required on the client side. Any one, please confirm !!
thanks
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I am not using dynamic loading of _Stub, policy file or RMISecurityManager in either client or server.
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
Any more opinions on the issue of whether it is OK not to use security manager on client side if dynamic downloading is not used i.e. stub file etc are part of client.jar ???
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I am not using java.policy or RMI Security Manager either in client or server. I am bundling _Stub classes with my client.jar
Abhinav Anand
Ranch Hand

Joined: May 02, 2002
Posts: 113
Hi guys,
I know that using dynamic class download can cause much trouble while documenting about the requirement of web server.
But just think that there is one server and more than 500 clients. So, a new functionality enhancement on server side would require to physically make available the stub file once again to all the clients. Do you think that one can pass with good score with this assumption.
Any suggetions are welcome
Thanks,
Vishal
Robin Underwood
Ranch Hand

Joined: May 01, 2002
Posts: 117
I'm having problems with this issue too. I already wrote my code using the standard assumption that the evaluator won't have a web server, but now I'm having second thoughts. Tomcat and Orion are free and easy to install. I'm just not sure it makes sense to have an RMI application without dynamic code downloading.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

I'm just not sure it makes sense to have an RMI application without dynamic code downloading.

In the real world you wuold be right. However this is not this and you are putting too much thought into it. You cannot and should not expect the assessor to have a webserver, or to download a free one.
So why worry and wast some time on this when it is beyond scope.

Mark
 
Consider Paul's rocket mass heater.
 
subject: Dynamic Stub Loading with file URL's