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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

764 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