Reputation: 1334
When I load my applet I get the Exception
java.security.AccessControlException: access denied ("java.awt.AWTPermission" "accessClipboard")
.
Have googled for couple of hours and have seen the answers like,
Adding the permissions in java policy - This is strictly internal process. But need to work in all machines.
Adding applet tag instead of object - Didn't work for me.
Keytool to be used to sign the applets - Have added the custom certificate to sign the applets. Still getting the exception.
Please help out guys.
Upvotes: 0
Views: 3178
Reputation: 1334
@yakovsh : The blog is really helpful. Just a small change worked for me...
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction(){
public Object run() {
// execute the privileged command
executeCommand(cmd);
// we must return an object, so we'll return an empty string
return new Object();
}
}
);
The only change is with the return statement from return ""
to return new Object()
Upvotes: 0
Reputation: 346
You can try using Javascript within Java to get to the privileged methods:
Upvotes: 1