我们的 Web 应用程序中有一个小程序,它没有在我们的开发/测试站点中运行,但在我们的生产站点中运行良好。只有当我们从 Mac Lion 上的浏览器访问该站点时才会出现问题 - 从 MSWin 客户端运行的任何浏览器(IE、FF、Safari、Opera)都没有问题。
dev 和 prod 站点之间的区别在于,生产站点具有购买的 SSL 站点证书,而开发站点具有自签名证书。如果我们不使用 ssl,小程序也可以在开发站点上正常工作。
该应用程序由 IIS 7 提供服务。启用了 Java 插件(否则我们将无法在开发盒上使用 http 或在生产盒上使用 ssl 运行小程序)。
小程序 jar 本身使用购买的证书进行签名。网页使用 JavaScript 与小程序交互。
html 页面包含以下小程序代码:
<object name="Previewer"
class="java-applet"
classid="java:com.[omitted].template.TemplateViewer.class"
type="application/x-java-applet"
archive="../Template/tv/TemplateViewer.jar"
height="425" width="270">
<param name="MAYSCRIPT" value="true" />
<param name="scriptable" value="true" />
<param name="archive" value="../Template/tv/TemplateViewer.jar" />
<!-- following parameters are used by the applet itself -->
<param name="TEMPLATE" value="[url omitted]" />
<param name="VERSION" value="1.7" />
<param name="AREA" value="AreaName" />
<param name="CUSTOMIZABLE" value="Y" />
<param name="BACKGROUND" value="[url omitted]" />
<param name="SHOWDROPDOWN" value="false" />
</object>
Java 控制台提供了堆栈跟踪(在问题末尾列出)。
我看到小程序类加载器抛出了 ClassNotFound 异常,这似乎是由带有“签名算法不匹配”的 CertificateException 引起的。
经过几个小时的谷歌,我一无所获,我在这里检查了所有“可能已经有你答案的问题”和“类似问题”,没有任何启发。
我所能猜测的是,这个问题是由使用自签名证书访问站点引起的,类似于某些移动设备对服务由 SSL 提供的媒体的敏感度。
现在的问题:
是什么导致了这个问题?
我们能做些什么来解决它?
这是包含堆栈跟踪的控制台日志:
Java Plug-in 1.6.0_26
Using JRE version 1.6.0_26-b03-383-11A511c Java HotSpot(TM) 64-Bit Server VM User home directory = /Users/[omitted]
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.,com.sun.javaws,com.sun.deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.apple.mrj.,com.apple.jdirect.,com.apple.audio.jdirect.,quicktime.internal.,com.sun.medialib.mlib.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@2de12f6d
basic: Plugin2ClassLoader.addURL parent called for https://[URL omitted]/Template/tv/TemplateViewer.jar
network: Cache entry not found [url: https://[URL omitted]/Template/tv/TemplateViewer.jar, version: null]
network: Connecting https://[URL omitted]/Template/tv/TemplateViewer.jar with proxy=DIRECT
network: Connecting http://[URL omitted]:443/ with proxy=DIRECT
javax.net.ssl.SSLProtocolException: Signature algorithm mismatch
at com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(HandshakeMessage.java:412)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at sun.plugin.PluginURLJarFileCallBack.downloadJAR(PluginURLJarFileCallBack.java:81)
at sun.plugin.PluginURLJarFileCallBack.access$000(PluginURLJarFileCallBack.java:48)
at sun.plugin.PluginURLJarFileCallBack$2.run(PluginURLJarFileCallBack.java:150)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.PluginURLJarFileCallBack.retrieve(PluginURLJarFileCallBack.java:127)
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:186)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:50)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:70)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(CachedJarURLConnection.java:201)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(CachedJarURLConnection.java:145)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(CachedJarURLConnection.java:91)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(DeployURLClassPath.java:752)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$800(DeployURLClassPath.java:631)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(DeployURLClassPath.java:698)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(DeployURLClassPath.java:690)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(DeployURLClassPath.java:652)
at com.sun.deploy.security.DeployURLClassPath$3.run(DeployURLClassPath.java:400)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:389)
at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:366)
at com.sun.deploy.security.DeployURLClassPath.getResource(DeployURLClassPath.java:230)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:966)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:955)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:134)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:240)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:675)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.security.cert.CertificateException: Signature algorithm mismatch
at sun.security.x509.X509CertImpl.parse(X509CertImpl.java:1737)
at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:179)
at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:90)
at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:305)
at com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(HandshakeMessage.java:410)
... 48 more
network: Cache entry not found [url: https://[URL omitted]/Template/tv/TemplateViewer.jar, version: null]
network: Connecting https://[URL omitted]/Template/tv/TemplateViewer.jar with proxy=DIRECT
network: Connecting http://[URL omitted]:443/ with proxy=DIRECT
network: Cache entry not found [url: https://[URL omitted]/Template/tv/TemplateViewer.jar, version: null]
network: Connecting https://[URL omitted]/Template/tv/TemplateViewer.jar with proxy=DIRECT
network: Connecting http://[URL omitted]:443/ with proxy=DIRECT
javax.net.ssl.SSLProtocolException: Signature algorithm mismatch
at com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(HandshakeMessage.java:412)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at sun.plugin.PluginURLJarFileCallBack.downloadJAR(PluginURLJarFileCallBack.java:81)
at sun.plugin.PluginURLJarFileCallBack.access$000(PluginURLJarFileCallBack.java:48)
at sun.plugin.PluginURLJarFileCallBack$2.run(PluginURLJarFileCallBack.java:150)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.PluginURLJarFileCallBack.retrieve(PluginURLJarFileCallBack.java:127)
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:186)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:50)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:70)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(CachedJarURLConnection.java:201)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(CachedJarURLConnection.java:145)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(CachedJarURLConnection.java:91)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(DeployURLClassPath.java:752)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$800(DeployURLClassPath.java:631)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(DeployURLClassPath.java:698)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(DeployURLClassPath.java:690)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(DeployURLClassPath.java:652)
at com.sun.deploy.security.DeployURLClassPath$3.run(DeployURLClassPath.java:400)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:389)
at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:366)
at com.sun.deploy.security.DeployURLClassPath.getResource(DeployURLClassPath.java:230)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:966)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:955)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:134)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:675)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.security.cert.CertificateException: Signature algorithm mismatch
at sun.security.x509.X509CertImpl.parse(X509CertImpl.java:1737)
at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:179)
at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:90)
at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:305)
at com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(HandshakeMessage.java:410)
... 46 more
network: Cache entry not found [url: https://[URL omitted]/Template/tv/TemplateViewer.jar, version: null]
network: Connecting https://[URL omitted]/Template/tv/TemplateViewer.jar with proxy=DIRECT
network: Connecting http://[URL omitted]:443/ with proxy=DIRECT
network: Cache entry not found [url: https://[URL omitted]/Orders/, version: null]
network: Cache entry not found [url: https://[URL omitted]/Orders/com/[omitted]/template/TemplateViewer.class, version: null]
network: Connecting https://[URL omitted]/Orders/com/[omitted]/template/TemplateViewer.class with proxy=DIRECT
network: Connecting http://[URL omitted]:443/ with proxy=DIRECT
network: Cache entry not found [url: https://[URL omitted]/Orders/com/[omitted]/template/TemplateViewer/class.class, version: null]
network: Connecting https://[URL omitted]/Orders/com/[omitted]/template/TemplateViewer/class.class with proxy=DIRECT
network: Connecting http://[URL omitted]:443/ with proxy=DIRECT
basic: load: class com.[omitted].template.TemplateViewer.class not found.
Java Plug-in 1.6.0_26
Using JRE version 1.6.0_26-b03-383-11A511c Java HotSpot(TM) 64-Bit Server VM User home directory = /Users/[omitted] load: class com.[omitted].template.TemplateViewer.class not found.
java.lang.ClassNotFoundException: com.[omitted].template.TemplateViewer.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:687)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
at java.lang.Thread.run(Thread.java:680)
Exception: java.lang.ClassNotFoundException: com.[omitted].template.TemplateViewer.class
Ignored exception: java.lang.ClassNotFoundException: com.[omitted].template.TemplateViewer.class