安全例外:尝试打开沙盒jar作为Trusted-Library

时间:2021-05-17 03:10:10

I'm trying to run an applet via a webpage but doing so gives me the error:

我正在尝试通过网页运行applet,但这样做会给我错误:

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

and I don't understand why. I'm trying to get at several jars with my applet but this is the only one that's causing the problem (at least for the moment). I looked at this similar question, but since I don't have an extra library (unless the applet.class counts which I haven't signed anyway), this doesn't seem to apply here. I looked at Mixing Signed and Unsigned Code, but "Enable - show warning if needed" is clicked, "Trusted-Library: true" is in the MANAFEST file, and I'm running firefox 3.6.24 (as specific for a Linux machine which I have). I'd appreciated your help.

而且我不明白为什么。我正试图用我的applet获得几个罐子,但这是导致问题的唯一一个(至少暂时)。我看了这个类似的问题,但由于我没有额外的库(除非applet.class计算我还没有签名),这似乎不适用于此。我查看了混合签名和未签名代码,但是单击“启用 - 显示警告,如果需要”,“Trusted-Library:true”在MANAFEST文件中,我正在运行firefox 3.6.24(特定于Linux机器)我有)。我很感激你的帮助。

jogl.all.jar's MANAFEST file:

jogl.all.jar的MANAFEST文件:

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

2 个解决方案

#1


3  

It looks as if you have not signed the jar (hence the "sandboxed" bit).

看起来好像你没有签署jar(因此是“沙盒”位)。

Writing trusted Java code that can safely be used by untrusted code is really, really difficult.

编写可以安全地被不受信任的代码使用的可信Java代码确实非常困难。

#2


2  

I had similar issue - the root cause was Java JRE installed as both 32bit and 64bit versions - basically there were 2 separate app entries visible in the "Control Panel/Add or remove programs" list.

我有类似的问题 - 根本原因是安装了Java JRE作为32位和64位版本 - 基本上在“控制面板/添加或删除程序”列表中可以看到2个单独的应用程序条目。

Apparently this was confisung my web browser (IE) and/or java plugin. Removing both JRE versions from the system, then installing the latest JRE from scratch solved the problem.

显然这是我的网络浏览器(IE)和/或java插件。从系统中删除两个JRE版本,然后从头开始安装最新的JRE解决了这个问题。

My issue was seen on Java 7u25.

我的问题出现在Java 7u25上。

#1


3  

It looks as if you have not signed the jar (hence the "sandboxed" bit).

看起来好像你没有签署jar(因此是“沙盒”位)。

Writing trusted Java code that can safely be used by untrusted code is really, really difficult.

编写可以安全地被不受信任的代码使用的可信Java代码确实非常困难。

#2


2  

I had similar issue - the root cause was Java JRE installed as both 32bit and 64bit versions - basically there were 2 separate app entries visible in the "Control Panel/Add or remove programs" list.

我有类似的问题 - 根本原因是安装了Java JRE作为32位和64位版本 - 基本上在“控制面板/添加或删除程序”列表中可以看到2个单独的应用程序条目。

Apparently this was confisung my web browser (IE) and/or java plugin. Removing both JRE versions from the system, then installing the latest JRE from scratch solved the problem.

显然这是我的网络浏览器(IE)和/或java插件。从系统中删除两个JRE版本,然后从头开始安装最新的JRE解决了这个问题。

My issue was seen on Java 7u25.

我的问题出现在Java 7u25上。