Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.rmi.server.codebase & java.rmi.server.hostname  RSS feed

 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The two above properties can be specified at the command line when invoking the RMI Server Object. I could not get their use. Can someone help me out with these properties.

------------------
Regds.
Mahindrakar
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rahul
When you start your rmi registry and it can't find the server classes in the classpath, you require both these properties to specify the location of your rmi server classes & stubs to the rmiregistry. Where the java.rmi.server.codebase specifies the codebase of the class files and java.rmi.server.host specifies the host.
Regards
Suneel
 
Ajit Kumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Just curious.
Why do we need to specify the host name for an RMI server. If it is running on, say test.com (dns name), Even if we do not give the hostname, will it not be test.com (or IP) by default?.
Under what conditions do we need to give the hostname??
Could you give an example of using the codebase?
Is it required only if we are considering the RMI through http(web server)?

Any information in this regard will be greatly appreciated.
thanks

[This message has been edited by Ajit Kumar (edited March 11, 2001).]
[This message has been edited by Ajit Kumar (edited March 11, 2001).]
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ajit,
Consider the scenario where the server and rmiregistry are running in different machines. The server requires to know the path to the stub to bind. This is specified by the codebase and the it also has to know where it is located. This we specify with the hostname.
Suneel
 
Ajit Kumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Is this scenario of specifying the codebase applicable for simple RMI also. OR is it only relevant if we are accessing the rmi server through a web browser.
The reason is : I have checked couple of examples on codebase parameter and they all start with a host name such as http://something.com/
They are referring to the http protocol (webserver involvement). Can we also specify the codebase for a simple rmi without involving the web server.
Thanks
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Its applicable for simple RMI App too.
Suneel
 
Ajit Kumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Could you give me an example of specifying the codebase for a simple rmi app.
thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!