• 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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

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

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 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
at sun.rmi.transport.proxy. RMIMasterSocketFactory.createSocket

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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!