• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI Applet !

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic