AccessControlException while an applet is executing
808981Oct 28 2010 — edited Oct 29 2010Hi to all:
I am developing an applet and I show it in the main JSP page of a service place in Tomcat (Linux).
The applet needs to access to some data in a smartcard and I use another class for this purpose. This class uses javaxsmartcardio and JNA.jar
In the first access from the applet to this class, the JVM shows this error:
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.reflect.generics.reflectiveObjects)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
at sun.plugin2.applet.Applet2SecurityManager.checkPackageAccess(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at PinApplet.init(PinApplet.java:47)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Excepción: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.reflect.generics.reflectiveObjects)
Why occurs this error?
I think about the permissions to access to low level (hardware) functions, but the exception is thrown in the line when a method of the class that implemented the access to the smartcard is first called.
I think about the permissions to the .class file, but all the involved files have 777.
Maybe, this message should be in "Java for devices, Card and TV", but I think that the error is in the applet or in something related with the browsers.
Thanks in advance
Dani