Java JRE 1.7u45 无法加载包含一些未签名条目的小程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19440841/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JRE 1.7u45 unable to load an applet containing some unsigned entries
提问by Gaurang
I am getting the following error while loading a java applet on JRE 1.7u45.
在 JRE 1.7u45 上加载 Java 小程序时出现以下错误。
java.lang.SecurityException: com.sun.deploy.net.JARSigningException:
Found unsigned entry in resource #name of the applet#
at com.sun.deploy.cache.CacheEntry.getJarFile(Unknown Source)
at com.sun.deploy.model.ResourceProvider.getCachedJarFile(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access00(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.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.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
This applet indeed contains one unsigned entry. However I cannot get this entry signed immediately because of third party technical issues.
这个小程序确实包含一个未签名的条目。但是,由于第三方技术问题,我无法立即签署此条目。
The same applet worked fine on JRE 1.7u40, but apparently there has been some change in JRE 1.7u45 adding some additional security features.
同一个小程序在 JRE 1.7u40 上运行良好,但显然 JRE 1.7u45 有一些变化,增加了一些额外的安全功能。
I tried to reduce the security level in Java to medium. This works on MAC but unfortunately does not work on windows.
我试图将 Java 中的安全级别降低到中等。这适用于 MAC,但不幸的是不适用于 Windows。
Any suggestions/workaround to get the applet to work would be greatly appreciated!
任何使小程序正常工作的建议/解决方法将不胜感激!
回答by Iri
there is a simple solution that have just worked for me - unsign all jars.
有一个简单的解决方案对我有用 - 取消所有罐子的签名。
Not the most elegant solution, since Oracle is trying to insist on signed code.
不是最优雅的解决方案,因为 Oracle 试图坚持签名代码。
回答by ceklock
I had a problem with Java Web Start, where some JAR files contained unsigned resources. I had to delete the unsigned resources from the JAR and then resign the JAR.
我在使用 Java Web Start 时遇到了问题,其中一些 JAR 文件包含未签名的资源。我不得不从 JAR 中删除未签名的资源,然后退出 JAR。
回答by Gaurang
To work around this, I just disabled Java cache on endpoint machine and the applet started working fine.
为了解决这个问题,我只是在端点机器上禁用了 Java 缓存,并且小程序开始正常工作。
回答by Saeed
You have to disable the java temporary files
您必须禁用 java 临时文件
In windows:
在窗口中:
- control panel
- java
- General Tab
- Temporary Internet File
- Settings button
- List item
- New Dialog : Temporary Files Settings dialog
- disable the option : keep temporary files on my computer.
- 控制面板
- 爪哇
- 常规选项卡
- 临时互联网文件
- 设置按钮
- 项目清单
- 新对话框:临时文件设置对话框
- 禁用选项:在我的计算机上保留临时文件。
回答by Phoenix14830
I had to uninstall all versions of Java, reinstall the latest version, clear the prompts, then add the website it was having as a trusted site. After that, the Java app loaded fine.
我必须卸载所有版本的 Java,重新安装最新版本,清除提示,然后将其拥有的网站添加为受信任站点。之后,Java 应用程序加载正常。
回答by Brandon
If you are using libraries that are already compiled and packaged into JARs, and signed by the author, you do not have to worry about signing them. But say, you've used someone else's source code (open source hopefully) and have compiled it on your own machine, you must remove the existing signature and re-sign that package. If you are using Java applets, they must be signed now, unless you enjoy a mountain of pain.
如果您使用的是已经编译并打包成 JAR 并由作者签名的库,则不必担心对它们进行签名。但是如果你使用了别人的源代码(希望是开源的)并在你自己的机器上编译它,你必须删除现有的签名并重新签名那个包。如果您正在使用 Java 小程序,则必须立即对它们进行签名,除非您感到非常痛苦。
Now, this also applies to the packaged libraries within your packaged jar. If they have already been signed, leave them alone. But if you must sign them, make sure you remove any existing certificates from the JAR file before you do so, the same way as your main applet.
现在,这也适用于打包 jar 中的打包库。如果他们已经签署了,不要管他们。但是,如果您必须对它们进行签名,请确保在执行此操作之前从 JAR 文件中删除所有现有证书,与您的主小程序相同。
Additional information that may help:Your MANIFEST.mf file in all JARs must contain entries for the the properties, as shown in the example below:
可能有帮助的其他信息:所有 JAR 中的 MANIFEST.mf 文件必须包含属性条目,如下例所示:
Application-Library-Allowable-Codebase: *
Permissions: all-permissions
Caller-Allowable-Codebase: *
Codebase: *
Application-Name: POSInterface
TIP
提示
If you're deploying a bunch of applets to a web application, I like to automate this whole process of modifying the manifest and code-signing with a batch file and text file containing the above properties that need to be in the manifest.mf file, named addToManifest.txt. Here is an example of how it's done:
如果您将一堆小程序部署到 Web 应用程序,我喜欢使用批处理文件和文本文件自动修改清单和代码签名的整个过程,其中包含需要在 manifest.mf 文件中的上述属性,命名为 addToManifest.txt。这是一个如何完成的示例:
@ECHO off
ECHO Changing manifest files for all...
jar ufm Applet_RFID.jar addToManifest.txt
jar ufm FingerPrintReader.jar addToManifest.txt
jar ufm jzebra.jar addToManifest.txt
jar ufm POSInterface.jar addToManifest.txt
jar ufm lib\access-bridge-32.jar addToManifest.txt
jar ufm lib\addToManifest.txt addToManifest.txt
jar ufm lib\dnsns.jar addToManifest.txt
jar ufm lib\dpuareu.jar addToManifest.txt
jar ufm lib\epsonupos.admin.jar addToManifest.txt
jar ufm lib\epsonupos.core.v1.13.0001.jar addToManifest.txt
jar ufm lib\epsonupos.H2000.jar addToManifest.txt
jar ufm lib\epsonupos.H6000IV.jar addToManifest.txt
jar ufm lib\epsonupos.jar addToManifest.txt
jar ufm lib\epsonupos.T20.jar addToManifest.txt
jar ufm lib\epsonupos.T81.jar addToManifest.txt
jar ufm lib\epsonupos.T81II.jar addToManifest.txt
jar ufm lib\epsonupos.T82.jar addToManifest.txt
jar ufm lib\epsonupos.T88V.jar addToManifest.txt
jar ufm lib\epsonupos.trace.jar addToManifest.txt
jar ufm lib\HWHydraSO.jar addToManifest.txt
jar ufm lib\jaccess.jar addToManifest.txt
jar ufm lib\jcl_editor.jar addToManifest.txt
jar ufm lib\jpos113-controls.jar addToManifest.txt
jar ufm lib\jpos113.jar addToManifest.txt
jar ufm lib\jssc_qz.jar addToManifest.txt
jar ufm lib\localedata.jar addToManifest.txt
jar ufm lib\plugin.jar addToManifest.txt
jar ufm lib\pos.jar addToManifest.txt
jar ufm lib\pos.v3.0001.jar addToManifest.txt
jar ufm lib\stario.jar addToManifest.txt
jar ufm lib\starjavapos.jar addToManifest.txt
jar ufm lib\sunec.jar addToManifest.txt
jar ufm lib\sunjce_provider.jar addToManifest.txt
jar ufm lib\sunmscapi.jar addToManifest.txt
jar ufm lib\sunpkcs11.jar addToManifest.txt
jar ufm lib\Symbol.RFID.API3.jar addToManifest.txt
jar ufm lib\uposcommon.core.v1.13.0001.jar addToManifest.txt
jar ufm lib\uposcommon.jar addToManifest.txt
jar ufm lib\xercesImpl.jar addToManifest.txt
jar ufm lib\xml-apis.jar addToManifest.txt
jar ufm lib\zipfs.jar addToManifest.txt
ECHO All JAR manifest have been altered.
PAUSE
ECHO Signing all Applets...
jarsigner Applet_RFID.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner FingerPrintReader.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner jzebra.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner POSInterface.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\access-bridge-32.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\-keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\dnsns.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\dpuareu.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.admin.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.core.v1.13.0001.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.H2000.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.H6000IV.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.T20.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.T81.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.T81II.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.T82.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.T88V.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\epsonupos.trace.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\HWHydraSO.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\jaccess.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\jcl_editor.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\jpos113-controls.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\jpos113.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\jssc_qz.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\localedata.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\plugin.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\pos.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\pos.v3.0001.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\stario.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\starjavapos.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\sunec.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\sunjce_provider.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\sunmscapi.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\sunpkcs11.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\Symbol.RFID.API3.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\uposcommon.core.v1.13.0001.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\uposcommon.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\xercesImpl.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\xml-apis.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
jarsigner lib\zipfs.jar -keystore "C:\Certificate\YourCertificate.key" <keystoreName> -storepass <SecretKey>
ECHO All JAR files have been signed.
PAUSE