rmi and applets

Posted on 2003-03-02
Medium Priority
Last Modified: 2013-12-29
I have a working server\client application working using java rmi. I am trying to convert the client so that it works in am applet but with some difficulty.

I get this error when i do appletviewer myApplet.java:

java.sercurity.AccessControlException: access denied(java.lang.RuntimePermission createSecuritymanger)

i was told to edit my policy file which looks like this:

grant {

      permission java.lang.RuntimePermission
    permission java.net.SocketPermission "*:1024-65535",
    permission java.net.SocketPermission "*:80", "connect";        
    permission java.io.FilePermission
        "c:\\home\\ann\\public_html\\classes\\-", "read";
    permission java.io.FilePermission
        "c:\\home\\jones\\public_html\\classes\\-", "read";

This is not one i made myself i just used it becasuse it worked at the time, is there anything that needs changing?

Also why would changing this help my applet to run because this policy is supplied to the server not the applet, help?
Question by:danBosh
1 Comment

Accepted Solution

lorddef earned 63 total points
ID: 8054533
Hmm yeh, the security manager is throwing a wobbley because the client is not in the same dir as the server.

Now let me think, rmi is a little fuzzy in my head now.

The policy file you have above is granting specific secure permissions for use in the applet (e.g. read only, port 80 only.. etc etc), and by the looks of it this is whats restricting you.  Just for now to test if it's the policy file or not try editing it too look like this:

     permission java.security.AllPermission;

If this works, then play about with the specific permissions you have above to see if you can get it to work with the tighter security (you could always try editing out each line of the policy file untill you find the error).

As I said rmi is slowly escaping me, so if anybody spots a booboo feel free to correct me ;)


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question