0

I'm trying to launch my java applet (version java 6) in server webpage but When I run it i have the next error:

    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.security.pkcs11)
    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 sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at es.inteco.applet.AppletFirmaDNIe.init(AppletFirmaDNIe.java:168)
    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.security.pkcs11)
Ignored exception: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.security.pkcs11)

With eclipse, this Applet works fine but when I try it in the server don't work. I'm using an unsigned applet (.jar). Can be this, the ploblem??

In my java .policy file I added these lines and still not working

grant {
permission java.security.AllPermission;
permission java.security.AccessControlException;
permission java.lang.RuntimePermission;
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.pkcs11";
};

the same error like with these original .policy file:

grant {
permission java.security.AllPermission;
};

Have anybody idea of the problem and the solution??

Thanks in advance

3 Answers 3

1

You need to sign your applet, and latest java security baseline will block any applet signed with an untrusted certificate authority.

If you choose to self-sign the applet, you may need to lower your java security settings in order for your applet to execute.

Sign up to request clarification or add additional context in comments.

Comments

0

Oracle's recent Java distributions (since roughly last summer) has disabled access to anything in any package that starts with "sun.".

This can be overcome by using policytool to add:

permission java.lang.RuntimePermission accessClassInPackage.sun.

to your local java.policy file.

Comments

0

add this to your java.policy file or use the policytool:

grant {
  permission java.lang.RuntimePermission accessClassInPackage.sun "com.acme.yourpackagename";
};

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.