JRE 1.7u45 не может загрузить апплет, содержащий некоторые неподписанные записи

Я получаю следующую ошибку при загрузке Java-апплета на JRE 1.7u45.

    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$1.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.access$1000(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.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$3.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$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.initAppletAdapter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Этот апплет действительно содержит одну неподписанную запись. Однако я не могу немедленно подписать эту запись из-за технических проблем третьей стороны.

Тот же апплет отлично работал на JRE 1.7u40, но, по-видимому, в JRE 1.7u45 произошли некоторые изменения, добавив некоторые дополнительные функции безопасности.

Я попытался снизить уровень безопасности в Java до среднего. Это работает на MAC, но, к сожалению, не работает на Windows.

Буду очень признателен за любые предложения/обходной путь, чтобы заставить апплет работать!


person Gaurang    schedule 18.10.2013    source источник
comment
Я не могу немедленно подписать эту запись из-за технических проблем третьей стороны. Какие "проблемы"? Один из обходных путей — подписать эти ресурсы самостоятельно.   -  person Andrew Thompson    schedule 18.10.2013
comment
Привет Андрей, Спасибо за ваш ответ. подписывать себя не вариант в моем случае.   -  person Gaurang    schedule 18.10.2013
comment
Примечания Oracle об изменениях безопасности. Вы также можете ознакомиться с примечаниями к выпуску java7u45. Также возможен ли откат к java7 update40?   -  person Claudiu    schedule 18.10.2013
comment
Вы решили это? У меня такая же ошибка в самоподписанной банке. Апплет работает нормально в 1.6 и 1.7.0_b147 Но такая же ошибка возникает в 1.7.0_55-b13   -  person August    schedule 05.08.2014
comment
См. также stackoverflow.com/questions/17923635/   -  person Vadzim    schedule 23.09.2016


Ответы (6)


Вы должны отключить временные файлы Java

В окнах:

  1. панель управления
  2. Ява
  3. Вкладка «Общие»
  4. Временный файл Интернета
  5. Кнопка настроек
  6. Пункт списка
  7. Новое диалоговое окно: диалоговое окно «Параметры временных файлов»
  8. отключить опцию: хранить временные файлы на моем компьютере.
person Saeed    schedule 09.12.2013
comment
также работает для 1.7_80 Java Plug-in 10.80.2.15 Using JRE version 1.7.0_80-b15 Java HotSpot(TM) Client VM - person Tilo; 03.12.2015

Чтобы обойти это, я просто отключил кэш Java на конечной машине, и апплет заработал нормально.

person Gaurang    schedule 23.10.2013

Если вы используете библиотеки, которые уже скомпилированы и упакованы в JAR-файлы и подписаны автором, вам не нужно беспокоиться об их подписи. Но скажем, вы использовали чужой исходный код (надеюсь, с открытым исходным кодом) и скомпилировали его на своей машине, вы должны удалить существующую подпись и повторно подписать этот пакет. Если вы используете апплеты Java, они должны быть подписаны сейчас, если только вы не наслаждаетесь горой боли.

Теперь это также относится к упакованным библиотекам в упакованном банке. Если они уже подписаны, оставьте их в покое. Но если вы должны подписать их, убедитесь, что вы удалили все существующие сертификаты из JAR-файла, прежде чем делать это так же, как и ваш основной апплет.

Дополнительная информация, которая может помочь: Ваш файл MANIFEST.mf во всех JAR-файлах должен содержать записи для свойств, как показано в примере ниже:

Application-Library-Allowable-Codebase: *
Permissions: all-permissions
Caller-Allowable-Codebase: * 
Codebase: *
Application-Name: POSInterface

СОВЕТ

Если вы развертываете кучу апплетов в веб-приложении, мне нравится автоматизировать весь этот процесс изменения манифеста и подписи кода с помощью пакетного файла и текстового файла, содержащего указанные выше свойства, которые должны быть в файле 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
person Brandon    schedule 08.05.2014

У меня была проблема с Java Web Start, где некоторые файлы JAR содержали неподписанные ресурсы. Мне пришлось удалить неподписанные ресурсы из JAR, а затем отказаться от JAR.

person ceklock    schedule 21.10.2013

Мне пришлось удалить все версии Java, переустановить последнюю версию, очистить подсказки, а затем добавить веб-сайт, который у него был, в качестве надежного сайта. После этого приложение Java загрузилось нормально.

person Phoenix14830    schedule 22.04.2014

есть простое решение, которое только что сработало для меня - отменить подпись всех банок.

Не самое элегантное решение, поскольку Oracle пытается настаивать на подписанном коде.

person Iri    schedule 18.10.2013