【问题标题】:Getting Exception: java.lang.SecurityException: attempted to open sandboxed jar as Trusted-Only出现异常:java.lang.SecurityException:试图将沙盒 jar 作为 Trusted-Only 打开
【发布时间】:2013-07-11 23:01:26
【问题描述】:

我们需要签署所有 5 个.class java 文件。我们通过创建一个.jar 文件并对其进行签名来完成。但是在执行我的 Web 应用程序时,它在 Java 控制台中显示以下错误消息

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*

我不确定这个错误。收到此错误后,我已签署 Jar 3-4 次,但我再次收到相同的错误。

如果我做错了什么,请有人帮助我吗?

【问题讨论】:

    标签: jarsigner


    【解决方案1】:

    检查 jar 的 Manifest.mf 文件。如果您使用的是 MixedCode(从 javascript 调用的 Applet)并且您的文件是自签名的,则这应该包含 Trusted-Library: true。 oracle 已在 Java 7 update 21 中发布了最新的安全更新。根据发行说明,您必须仅使用 CA 证书 签署您的代码,否则 JRE 会将您的代码视为恶意代码。 oracle 完全弃用了 Mixedcode。请查看release notes of latest updates。但在 ma​​nifest.mf 中添加属性 Trusted-Library: true 之前,请确保您了解该属性的影响。

    【讨论】:

      猜你喜欢
      • 2014-05-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多