wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes AccesscontrolException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "AccesscontrolException" Watch "AccesscontrolException" New topic
Author

AccesscontrolException

rajani adapa
Ranch Hand

Joined: Jan 24, 2001
Posts: 54
WHen i run my server in the rmi program iam getting an error message saying,
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)
I've no idea what is going on over there.
Can anybody help me
please........
rajini
Fredrik Safstrom
Greenhorn

Joined: May 15, 2001
Posts: 20
Rajini,
Try adding upp the following lines in your {Java Home}\jre\lib\security\java.policy file:
// Special permission for RMI.
permission java.net.SocketPermission "*", "connect";
permission java.net.SocketPermission "*", "accept";
Your file should then look something like this:

You also have to start the rmiregistry in a second dos-prompt (or second shell on unix). Just start a new dos-prompt and type rmiregistry.
/Bamse
rajani adapa
Ranch Hand

Joined: Jan 24, 2001
Posts: 54
Thank you .
It's working now.
And i 've one more question.
IAm trying to use bean in my client program.
When iam trying to include all three files in a single package as,package mypkg;
in all three files of my rmi application,Neither of my server and client not accessing the interface.
What is the problem?
please correct me if iam wrong
rajini
rajani adapa
Ranch Hand

Joined: Jan 24, 2001
Posts: 54
Sorry ,
Oops!! I FORGOT TO INCLUDE THE PACKAGE IN SPECIFIED DIRECTORY.
sORRY FOR THE INCONVENIENCE.
And now i got it's working fine.
Once again thanku very much
rajini
chr rosa
Greenhorn

Joined: Aug 01, 2003
Posts: 1
What are the security implications of adding
// Special permission for RMI.
permission java.net.SocketPermission "*", "connect";
permission java.net.SocketPermission "*", "accept";
to {Java Home}\jre\lib\security\java.policy file
That is, while it is necessary to make the aforementioned
modifications in order to activate the rmi service
functionality, is there any danger
in terms of overall security on the Unix server.
Thanks for your thoughts.
Best regards
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

I am using tomcat as my webserver and i am facing the problem while viewing the applet in IE . Its giving the exception saying java.security.AccessControlException:access denied ....But the same works fine when i use an IDE like eclipse for running the same applet

I tried editing the java policy file and even the catalina (Tomcat's policy file) by adding

permission java.net.SocketPermission "*", "connect";
permission java.net.SocketPermission "*", "accept";

But still i am getting the same error . Can any one let me know why this is still coming ??
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

An applet will run differently in Eclipse vs. Tomcat because (most likely) Eclipse is using AppletViewer to run the applet - AppletViewer is like a "test environment" to quickly test your applet and make sure it is working without going through deploying the applet to a webserver, etc. One of the main things AppletViewer "skimps on" is the applet sandbox - this is why you are getting an AccessControlException. Changing Tomcat's policy file isn't going to help you here - the applet is really running in the client's browser, not Tomcat.

Read up on the "Applet Sandbox". Of primary interest is this - " It cannot make network connections except to the host that it came from."

If you really need to do whatever you're doing to cause the AccessControlException, you'll need to make a signed applet.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

By the way - this really should have been a new post, rather than added on to the existing thread... and it should have been in the "Applets" forum...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: AccesscontrolException