安全异常:尝试将沙盒 jar 作为可信库打开

2024-04-11

我试图通过网页运行小程序,但这样做会出现错误:

java.lang.reflect.InvocationTargeException
       at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:116)
       at sun.plugin2.applet.Plugin2Manager.runOnEDT(Plugin2Manager.java:3520)
       at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3051)
       at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
       at java.lang.Thread.run(Thread.java:662)
Caused by:java.lang.SecurityExcption: attempted to open sandboxed jar file :/home/daniel/workspace/project/jars/jogl/jogl.all.jar as a Trusted-Library
       at com.sun.deploy.security.CPCallbackHandlers$ParentElement.checkResources(CPCallbackHandler.java:358)
       at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(DeployURLClassPath:852)
       ....more stuff I don't want to have to retype but I can if necessary

我不明白为什么。我试图用我的小程序获取几个罐子,但这是唯一导致问题的罐子(至少目前如此)。我在看这个类似的问题 https://stackoverflow.com/questions/7093935/java-webstart-attempt-to-sandboxed-jar-as-trusted-library,但由于我没有额外的库(除非 applet.class 算作我还没有签名),所以这似乎不适用于此处。我在看混合签名和未签名代码 http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/mixed_code.html#manifest,但是单击了“启用 - 如果需要则显示警告”,“Trusted-Library: true”位于 MANAFEST 文件中,并且我正在运行 firefox 3.6.24(特定于我拥有的 Linux 计算机)。我很感激你的帮助。

jogl.all.jar 清单文件:

Manifer-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_24-b07 (Sun Microsystems Inc.)
Specification-Title: Java Bindings for OpenGL API Specification
Specification-Version: 2.0
Specificaiton-Vender: JogAMp Community
Implementation-Title: Java Bindings for OpenGL Runtime Environment
Implementation-Version: 2.0-b23-20110303
Implementation-Branch: rc
Implementation-Commit: bcf5d6ac871a29398b441df617923d3dd2cf35c1
Implementation-Vendor: JogAmp Community
Implementation-URL: http://jogamo.org/
Extension-Name: javax.media.opengl
Implementation-Vendor-Id: com.jogamp
Trusted-Library: true

看起来好像您还没有对 jar 进行签名(因此是“沙盒”位)。

编写可以被不可信代码安全使用的可信 Java 代码是really, really难的。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

安全异常:尝试将沙盒 jar 作为可信库打开 的相关文章

随机推荐