2013-07-05 56 views
0

我們需要簽署所有5 .class java文件。我們通過創建一個.jar文件並簽署了它。但是,在執行我的web應用程序是顯示以下錯誤消息Java控制檯獲取異常:java.lang.SecurityException:試圖打開沙箱jar作爲Trusted-Only

java.lang.SecurityException: attempted to open sandboxed jar https://xxxxxxxxxxx.com/xxxx/JavaApplet.jar as Trusted-Only 
at com.sun.deploy.security.CPCallbackHandler$ParentElement.checkResource(Unknown Source) 
at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source) 
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) 
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source) 
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) 
at java.security.AccessController.doPrivileged(Native Method) 
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) 
at sun.plugin2.applet.Applet2ClassLoader.findClass(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 sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) 
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) 
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) 
at java.lang.Thread.run(Unknown Source) 
Exception: java.lang.SecurityException: attempted to open sandboxed jar https://xxxxxxxxxxx.com/xxxx/JavaApplet.jar as Trusted-Only* 

我不知道這個錯誤。在得到這個錯誤之後,我已經簽了3-4次Jar,但我又一次得到了同樣的錯誤。

如果我做錯了什麼,請任何人都可以幫助我嗎?

回答

1

檢查您的Manifest.mf文件的jar。如果您使用的是MixedCode(從JavaScript調用的Applet)並且您的文件是自簽名的,則應包含Trusted-Library: true。 oracle已發佈最新的安全更新Java 7更新21。根據發行說明,您必須僅使用CA證書簽署代碼,否則JRE會將您的代碼視爲惡意代碼。 oracle完全不贊成混合代碼。請檢查release notes of latest updates。但在添加屬性Trusted-Library: true之前,請在manifest.mf之前確保您瞭解該屬性的效果。