Forum Stats

  • 3,851,370 Users
  • 2,263,968 Discussions
  • 7,904,689 Comments

Discussions

AccessControlException while an applet is executing

808981
808981 Member Posts: 27
edited Oct 29, 2010 5:26AM in Java Applet Development
Hi 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

Answers

  • PhHein
    PhHein Member, Moderator Posts: 7,245 Silver Trophy
    For any kind of file access from an applet you have to sign it. See this http://download.oracle.com/javase/tutorial/security/tour1/index.html and google for various resources.
  • 808981
    808981 Member Posts: 27
    Ok, I read the information in the link.
    I suppose that your answer is that the error is caused by problems with access permissions, because your answer is not enough precise.
    If I have any problems, I will reply here.

    Dani

    P.S. What does the "badgerbadgerbadger" tag mean??
  • 793415
    793415 Member Posts: 7,279 Bronze Badge
    805978 wrote:
    ..P.S. What does the "badgerbadgerbadger" tag mean??
    Good question. I think it means that everyone who uses the tag thinks the entire tagging system is stupid or pointless, but I'd like to hear their thoughts on it.
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    edited Oct 28, 2010 7:25PM
    I suppose that your answer is that the error is caused by problems with access permissions
    The exception and stack trace already told you that. 'Access denied' is perfectly clear.
    because your answer is not enough precise.
    I fail to see anything imprecise about his answer. For any kind of file access from an applet you have to sign it. Nothing imprecise there.

    I find this response somewhat offensive.
  • PhHein
    PhHein Member, Moderator Posts: 7,245 Silver Trophy
    edited Oct 29, 2010 3:08AM
    Andrew Thompson wrote:
    805978 wrote:
    ..P.S. What does the "badgerbadgerbadger" tag mean??
    Good question. I think it means that everyone who uses the tag thinks the entire tagging system is stupid or pointless, but I'd like to hear their thoughts on it.
    1774956
  • 793415
    793415 Member Posts: 7,279 Bronze Badge
    PhHein wrote:
    Andrew Thompson wrote:
    805978 wrote:
    ..P.S. What does the "badgerbadgerbadger" tag mean??
    Good question. I think it means that everyone who uses the tag thinks the entire tagging system is stupid or pointless, but I'd like to hear their thoughts on it.
    1774956
    Aah. So not merely stupid and pointless, but possibly counter-productive and dangerous!

    Too bad. To be honest, I had not used tags before, and was wondering if they had any positive aspects (and if so, how). That post has turned me against them. But I will not be joining the badgerbadgerbadger brigade, and will still happily use emoticons. ;)
This discussion has been closed.