Firefox 52.4.1上的Java Applet“ClassNotFoundException” - 适用于IE

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Firefox 52.4.1上的Java Applet“ClassNotFoundException” - 适用于IE相关的知识,希望对你有一定的参考价值。

我们需要在Firefox 52.4.1(与Java Applet兼容的最新版本)和Internet Explorer 11上运行使用Java 8 Applet(生病)的旧Web应用程序。

applet基于Java 8,由Apache Tomcat服务器分发。它是签名和混淆的(Proguard)。

用户使用智能卡通过SSL相互身份验证连接到网站(客户端需要PKCS11模块才能从智能卡获取证书)。 SSL相互身份验证也是使用Java Applet完成的。

所有证书都由在每个浏览器,Windows和Java证书库中添加的权限签名。

这里是html代码:

<object classid='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93' id='AsapiObject'>
    <param name='archive' value='../../../applet/myapplet.jar'/>
    <param name='code' value='main.package.Main'/>
    <param name='name' value='My Applet'/>
    <param name='mayscript' value='true'/>
    <comment>
        <applet id='AsapiApplet'
                name='My Applet'
                archive='../../../applet/myapplet.jar'
                code='main.package.Main'
                MAYSCRIPT="MAYSCRIPT">
        </applet>
    </comment>
</object>

(关注https://docs.oracle.com/javase/8/docs/technotes/guides/jweb/applet/using_tags.html#applet的推荐)

它在IE 11上工作正常,而不是在Mozilla Firefox 52.4.1上工作。两者都是相同的JRE。

在Mozilla Firefox 52.4.1上,我有一个Java异常:

java.lang.ClassNotFoundException: main.package.Main
    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.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    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:748)

在此例外之前,我有一个handshake failure exception

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
    at sun.plugin.PluginURLJarFileCallBack.connect(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:205)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:71)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:109)
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
    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$800(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 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.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    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:748)

我认为Firefox无法从智能卡正确导入客户端证书。

编辑:Java控制台中还有另外两个有趣的行:

security: Accessing keys and certificate in Mozilla user profile: null
security: JSS is not configured

通过增加调试模式(-Djavax.net.debug=all),我看到:

  • IE浏览器 : *** ServerHelloDone [read] MD5 and SHA1 hashes: len = 4 0000: 0E 00 00 00 .... ssl: KeyMgr: getting aliases: [XXXXXXX (verified: OK), YYYYYYYYYYYYYY] ssl: Ignoring alias XXXXXXX (1): key algorithm does not match ssl: Ignoring alias XXXXXXX: key algorithm does not match ssl: Ignoring alias XXXXXXX (2): key algorithm does not match ssl: KeyMgr: no matching alias found ssl: Ignoring alias XXXXXXX (1): key algorithm does not match ssl: Ignoring alias XXXXXXX: key algorithm does not match ssl: Ignoring alias XXXXXXX (2): key algorithm does not match ssl: KeyMgr: no matching alias found *** Certificate chain chain [0] = [ ...
  • 火狐浏览器 : *** ServerHelloDone [read] MD5 and SHA1 hashes: len = 4 0000: 0E 00 00 00 .... Warning: no suitable certificate found - continuing without client authentication *** Certificate chain <Empty> ***

我试过/检查了很多东西:

  • 检查Firefox上是否正确安装了IAS_PKCS11模块:

Firefox PKCS11 module

我真的需要帮助。

任何的想法? (我无法将applet切换到另一件事 - 我没有这个选择)

答案

看起来问题出在您的网络服务器提供https上。

一个随机的谷歌抛出Mozilla Security Blog。默认情况下,在您使用的Firefox版本中禁用SHA-1(52)。 MD5是一种比SHA-1更差的哈希算法。

所以大概你应该至少更新网络服务器。如果你不顾一切地继续使用本应该已经装箱的软件,那么我猜你在Firefox中可能仍然有配置选项,或者使用版​​本51,但我真的不推荐它。

以上是关于Firefox 52.4.1上的Java Applet“ClassNotFoundException” - 适用于IE的主要内容,如果未能解决你的问题,请参考以下文章

Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web appl

单击Firefox上的按钮与Firefox上的vbsscript

在 Red Hat 上的 Firefox 中播放 wav 文件

Firefox 和 Safari 上的下拉箭头样式错误

Firefox 输入忽略 Arch Linux 上的高度

Firefox 上的 CSS 缩放转换问题