This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes RMI Applet ! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI Applet !" Watch "RMI Applet !" New topic
Author

RMI Applet !

Betty Cramer
Greenhorn

Joined: Nov 19, 2003
Posts: 4
Hello,
First timer here...bear with me.
I am running a RMI server and an applet with one interface for the RMI Server. This part works fine. The .class files and the html is deployed thru TOMCAT 4.1
The problem is however when the server code is changed to handle callbacks with the applet. Have already changed the security policy file. Now the applet too has its own interface.
Compiled the .java files and also rmic applet and rmic server. Started the registry after that. And the server too with the codebase too mentioned with -Djava.rmi.server.codebase. (As in the HelloWorld example on the sun website) So far so good.
However as soon as I load the appletviewer as http://localhost:8080/page.html (As I am running Tomcat) the error I get is:
IO Exception while reading: Connection refused: connect
Everything is right now local and am lost...Any help will be really appreciated. Thanks a bunch.
Chris Shepherd
Ranch Hand

Joined: Jun 27, 2000
Posts: 286
OK, I'm not understanding whether you created a second interface or whether you just expanded the one you had. Do you mean that you are trying to run the applet as a server so that your real server can call it back? I'm not sure if you can have an applet act as a server.
Any one else know? (Michael?)
Is there any way you could set up a polling system where your applet just touches base with the server and if there is anything that needs to be passed to the applet you get a returned value that then touches off a different request from the applet for the specific data to be retrieved?
This is a bit out of my league since I haven't done applets with RMI, but I'll help as I can.
Chris
Betty Cramer
Greenhorn

Joined: Nov 19, 2003
Posts: 4
I am sorry for not being very clear on this. Hope this helps.
This link has the "QuoteServer" example which is on the same lines as my project.
http://engronline.ee.memphis.edu/advjava/Examples/RMI/rmi_example.htm
In the above example I compile all four files and then generate rmic for applet and server. Then I place all the class files and the related html for the applet in TOMCAT.
Policy file:
grant {
// Allow everything for now
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "connect,accept";
permission java.net.SocketPermission "*:80", "connect";
};
Then I start my TOMCAT and then the server with codebase=http:\\localhost:8080\(my folder)\ and the security file as mentioned above. So far so good.
The problem occurs when I start my applet as
appletviewer -J-Djava.security.policy="above file here" http:\\localhost:8080\page.html
Also when I loaded the applet in IE I got the AccessControlException:access denied. Can you also direct me as to how to direct the above security policy file in IE?
Thanks in advance for your patience. I hope I am clearer this time. Please let me know if more details are required.
Appreciate your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI Applet !
 
Similar Threads
Perl/Cgi in Tomcat 5.5
Accessing RMI Application through an Applet hosted on Apache web server
Tomcat with PWS - help
http://localhost:8080 stopped responding
URL Connection