Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.security.AccessControlException: access denied

843833Jan 14 2010 — edited Jan 26 2010
Hello, I have an applet that is launched using the new JNLP <param> method from java 1.6.10+. The applet connects to a web service to get some data. It is a signed applet and I have set the security permissions in the JNLP to <all-permissions>. The applet runs fine, connects to the web service and pulls out some data by itself at initialization and when called by a thread that sleeps every 1 second.

I'm using the Javascript plugin to interact with javascript to have some controls in HTML. When I change a combo box in javascript, it calls a public method on the applet that then calls the same web service function that is being called at initialization and by the thread to update data displayed on the applet. Whenever I try to do this, I get the following exception:

java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.Thread.setContextClassLoader(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)

Everything runs up to the previous code line that accesses the web service, so I know it is getting up to that point, I even have some debug output and I see it on the Java Console, but when it gets to the web service method call, it throws that exception. It only happens when it is called by a method that was triggered by a javascript action, like the 'onclick' of a javascript select or the 'onclick' of a button, which are initiated by user interaction.

Any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2010
Added on Jan 14 2010
2 comments
1,861 views