• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

AccesscontrolException

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!