Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

NX: rmiregistry, rmi classpath, rmi.policy

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I decided to use RMI for my URLyBird solution. I have all my code, including RMI stubs, packaged in the runme.jar.
For RMI, I have understood that I need to set the code base property and supply a policy file. I created a rmi.policy file in the same directory as the .jar root:

When I start my server, I setup the system properties as follows:

Unfortunately, I get an AccessControlException with these settings. For some reason, it can't access the full path to the file. If I set the codebase to be the following URL, I don't get the AccessControlException:

Unfortunately, the rmiregistry cannot seem to resolve my stub files. However, if I add my runme.jar to the CLASSPATH, everything works ok.
I thought the rmiregistry would be able to download my stubs from the codebase I specified without having to have an entry in the CLASSPATH. If this is possible, I would greatly appreciate some pointers on how to get it setup, because I'm missing something.
Is it acceptable to require setting a CLASSPATH entry to runme.jar? I am extremely nervous about doing so. The instructions allow so little local machine configuration.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Paul F. Williams:
...
Is it acceptable to require setting a CLASSPATH entry to runme.jar? I am extremely nervous about doing so. The instructions allow so little local machine configuration.


Hi Paul-- you got a great name there.
I don't have the URLybird assignment, but if it's configuration specs are like the Contractors Assignment -- stating that "all configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration infomration must be stored in a file called suncertify.properties..." then I believe it is safe to build a GUI which takes input and programatically sets all the System properties you'd like to initialize. (I believe there's a System property for the jvm's CLASSPATH?)
ie: when initializing my RMI Server I asked the user via JDialog for the server's identifying hostname on the net, and then i programatically set the java.rmi.server.hostname property to their input. I had to do this since my computers are behind a router and by default my registry kept giving clients my NAT IP instead of my (reachable) WAN IP
HTH
Paul
[ November 04, 2003: Message edited by: Paul Tongyoo ]
[ November 04, 2003: Message edited by: Paul Tongyoo ]
 
Paul F. Williams
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Paul Tongyoo:

I don't have the URLybird assignment, but if it's configuration specs are like the Contractors Assignment -- stating that "all configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration infomration must be stored in a file called suncertify.properties..." then I believe it is safe to build a GUI which takes input and programatically sets all the System properties you'd like to initialize. (I believe there's a System property for the jvm's CLASSPATH?)


Yes, URLyBird does allow for creating a configuration file. However, my UI-sense gets queasy about asking users for entering a CLASSPATH. I don't mind so much for specifying server name/port information.

ie: when initializing my RMI Server I asked the user via JDialog for the server's identifying hostname on the net, and then i programatically set the java.rmi.server.hostname property to their input. I had to do this since my computers are behind a router and by default my registry kept giving clients my NAT IP instead of my (reachable) WAN IP


Ouch. Yes, there are all sort of complications a real network would bestow on our solutions. I haven't thought about NAT'ed IP's. I also haven't thought about tunneling through a proxy/firewall using RMI. I'm going to punt on that stuff for this assignment, but I'll discuss it in my choices.txt file.
I'm thinking of ditching RMI and using straight sockets. I'm more used to the latter solution.
 
What a show! What atmosphere! What fun! What a tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic