Applet/Servlet RMI Communication Questions
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jamie_Allen
Posted On:   Wednesday, March 5, 2003 07:18 PM

I have a simple proof-of-concept applet that is intended to show how a servlet can "push" data back to a client via RMI. The concept of the test is simple - clients can submit a "vote" value through the applet to a servlet, which maintains a list of connected clients. Once the servlet adds the vote value to the aggregate tally, it cycles through the list of clients and tells each to update its displayed value to reflect the change. I am using Tomcat v4.1.18 as my standalone host to support this. I have a couple of questions regarding this: 1. Does both the client running the applet and the servlet container each have to have an instance of the rmiregistry running in order for this to work? I've based   More>>

I have a simple proof-of-concept applet that is intended to show how a servlet can "push" data back to a client via RMI. The concept of the test is simple - clients can submit a "vote" value through the applet to a servlet, which maintains a list of connected clients. Once the servlet adds the vote value to the aggregate tally, it cycles through the list of clients and tells each to update its displayed value to reflect the change. I am using Tomcat v4.1.18 as my standalone host to support this.



I have a couple of questions regarding this:



1. Does both the client running the applet and the servlet container each have to have an instance of the rmiregistry running in order for this to work? I've based my communication on Jason Hunter's "Chat Server" example in his book, "Java Servlet Programming" (O'Reilly). Personally, I think not, since the applet gets the registry location from the server, but I just wanted to make sure.



2. How do I start the rmiregistry with respect to Tomcat? I purchased the book "Professional Apache Tomcat" (WROX), but it makes no mention of this kind setup. I've tried starting rmiregistry as a separate thread prior to starting the Tomcat server, but I don't know if that necessarily does the trick. Are the details of the RMI communication handled internally, or do I need to configure the server to start its own rmiregistry instance somehow in the server.xml file?



3. Do I need to set up some kind of Tomcat Connector to support RMI communication for this? "Professional Apache Tomcat" only mentions that Tomcat supports connectors for HTTP v1.0, v1.1 (with or without SSL), AJP and WARP. Or is this unnecessary?



Thanks. Any assistance would be greatly appreciated.



Jamie

   <<Less

Re: Applet/Servlet RMI Communication Questions

Posted By:   kumar_padhu  
Posted On:   Friday, May 30, 2003 10:31 PM

1.basically you cant have two instances of rmiregistry runnig on the same port.

2.you cannot start rmiregistry frorm tomcat, just copy your server files (interface,stub,skeleton )to omcatclasses and run the rmiregistry as a background process.
About | Sitemap | Contact