Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Problem RMI and Applet (java.security. AccessControlException)  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,
I wrote RMI application and it worked well and fine. then my supervisior asked me to change the client to applet. when I run the applet and it try to connect to the server I got the following error message:
********************************
java.security.AccessControl Exception: access denied (java.net.SocketPermission 172.23.11.206:1099 connect,resolve)
at java.security. AccessControlContext. checkPermission(AccessControlContext.java:264)
at java.security. AccessController. checkPermission(AccessController.java:427)
at java.lang.SecurityManager. checkPermission(SecurityManager.java:532)
at java.lang. SecurityManager.checkConnect(SecurityManager.java:1034)
at java.net.Socket. connect(Socket.java:501)
at java.net.Socket. connect(Socket.java:457)
at java.net.Socket. <init>(Socket.java:365)
at java.net.Socket. <init>(Socket.java:178)
at sun.rmi.transport. proxy.RMIDirectSocketFactory. createSocket
(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy. RMIMasterSocketFactory.createSocket
(RMIMasterSocketFactory.java:128)
.
.
.
*******************************************************

in the server side all allow all permisions
grant {
permission java.security.AllPermission;
};

what could be the problem and what is the soultion??
 
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets are limited in what functionality they can perform natively. You cannot override these limits in the Applet's code, or set them server side. You must sign the applet and have the user grant the applet permission to perform the desired function. Alternatively, you can alter the JVM's default security settings on the client. This is often less desirable since it involves a client touch for any client that will run the applet. In a controlled client environment, this may not be as much of an issue. The danger of the client touch is that if it done improperly, you can end up granting other undesirable applets full permission and eliminating Java's security Take a look at Sun's Applet Security FAQ and This JavaWorld Article, and the Sun's Development guide. You can also Google the topics Applet Security and Code Signing.
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!