Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Tomcat as web server with RMI  RSS feed

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I have been reading RMI tutorial at Java's site.
the tutorial assumes that the server classes will be in the following dirs (in Windows) :
c:\home\ann\src;c:\home\ann\public_html\classes\compute.jar
and to run the server, we use :
java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes/
I have Tomcat (as you know, Tomcat can be used as a web server), and I want to use Tomcat as a web server which hosts my RMI server classes.
so, I have two Qs :
1. where to put my RMI server classes ? (under webapps dir of Tomcat ?)
2. what is the value of :
-Djava.rmi.server.codebase ?
(I think the value will be the URL in Q 1, right) ?
thanks....
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a RMI example from Sun that uses classes provided through a web server.

For Tomcat, I think you would need to make a web app and put the class files somewhere publicly accessable in it. (i.e. - [b]not[b] under C:\Tomcat\webapps\MyApp\WEB-INF\classes, but somewhere inside C:\Tomcat\webapps\MyApp) And yes, you would use the URL in step 1 for the java.rmi.server.codebase value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!