2014-03-19 74 views
0

我想用數字簽名來實現applet。但是,訪問USB令牌時出現錯誤。我認爲由於Java安全性而導致錯誤的原因是阻止訪問。Applet pcks11安全錯誤

錯誤日誌:

basic: exception: java.lang.reflect.InvocationTargetException. 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.runOnEDTAndWait(Unknown Source) 
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.instantiateApplet(Unknown Source) 
    at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source) 
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.reflect.InvocationTargetException 
    at com.sun.deploy.uitoolkit.impl.awt.OldPluginAWTUtil.invokeAndWait(Unknown Source) 
    ... 5 more 
Caused by: 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.SecurityManagerHelper.checkPackageAccessHelper(Unknown Source) 
    at sun.plugin2.applet.AWTAppletSecurityManager.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 com.fit.signer.tokenserver.controller.TokenController.init(TokenController.java:37) 
    at com.fit.applet.SignApplet.<init>(SignApplet.java:26) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at java.lang.Class.newInstance(Unknown Source) 
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$1.run(Unknown Source) 
    at java.awt.event.InvocationEvent.dispatch(Unknown Source) 
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) 
    at java.awt.EventQueue.access$200(Unknown Source) 
    at java.awt.EventQueue$3.run(Unknown Source) 
    at java.awt.EventQueue$3.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) 
    at java.awt.EventQueue$4.run(Unknown Source) 
    at java.awt.EventQueue$4.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) 
    at java.awt.EventQueue.dispatchEvent(Unknown Source) 
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
    at java.awt.EventDispatchThread.run(Unknown Source) 
Ignored exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 

什麼我需要做解決問題嗎?

+0

也許這篇文章可以幫助? :http://stackoverflow.com/questions/19542427/java-applet-cant-open-files-under-safari-7-mac-os-x-10-9 – Ahmed

回答

0

解決方案:

我簽署了Jar文件。

的jarsigner -keystore E:\ cloudsignerstore E:\ CloudSigner.jar cloudsigner