wood burning stoves 2.0*
The moose likes Applets and the fly likes Problem RMI and Applet (java.security. AccessControlException) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Problem RMI and Applet (java.security. AccessControlException)" Watch "Problem RMI and Applet (java.security. AccessControlException)" New topic
Author

Problem RMI and Applet (java.security. AccessControlException)

Sultan Al-Yahyai
Greenhorn

Joined: Nov 07, 2004
Posts: 7

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??
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

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.
 
 
subject: Problem RMI and Applet (java.security. AccessControlException)
 
Similar Threads
RMI SocketPermission exception from Applet - works from Netbeans
RMI binding
Internal Server Error - Null Pointer
AccessControlException with rmi
live website chat application!