带有签名 JNLP 模板的签名小程序产生 java.lang.SecurityException [英] Signed applet w/ signed JNLP template produces java.lang.SecurityException

查看:62
本文介绍了带有签名 JNLP 模板的签名小程序产生 java.lang.SecurityException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在签署 RIA 使用的 JNLP 文件,为即将到来的 7u51 中的 >更严格的安全限制,将于 1 月到期.webstart 版本运行良好,但我遇到了小程序版本无法启动并出现以下异常的问题.

I'm signing the JNLP file used by my RIA, in preparation for the coming tighter security restrictions in 7u51, due in January. The webstart version is working great, but I've run into a problem where the applet version fails to launch with the following exception.

Google 显然从未听说过这个例外.:(

Google has apparently never heard of this exception. :(

java.lang.SecurityException: JAR should not contain JNLP-INF/APPLICATION_TEMPLATE.JNLP
        at sun.plugin2.applet.Applet2ClassLoader.getPermissions(Unknown Source)
        at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:206)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)
        at sun.plugin2.applet.Plugin2ClassLoader.access$100(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(ClassLoader.java:358)
        at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:744)

推荐答案

问题是小程序没有被部署为 JNLP 小程序.7u25 中引入了一个安全修复程序,旨在防止通过旧的 标记部署机制重新利用 JNLP 小程序.此异常表明安全修复程序已被触发.

The problem was that the applet was not being deployed as a JNLP applet. A security fix was introduced in 7u25 that was intended to prevent the re-purposing of a JNLP applet via the legacy <applet/> tag deployment mechanism. This exception indicates that that security fix has been tripped.

变通方法是始终将您的小程序部署为 JNLP 小程序,或者使用不包含 JNLP-INF 目录的 JAR 文件的不同变体.

The work-around is either to always deploy your applets as JNLP applets, or to use a different variant of the JAR file that does not contain a JNLP-INF directory.

请注意,如果您签署的是 JNLP 本身而不是模板,您也可能会看到此变体:

Note that you may also see this variant if you're signing the JNLP itself rather than a template:

java.lang.SecurityException: JAR should not contain JNLP-INF/APPLICATION.JNLP

这篇关于带有签名 JNLP 模板的签名小程序产生 java.lang.SecurityException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆