• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem RMI and Applet (java.security. AccessControlException)

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic