Applet 加载因 SSL 而失败
Applet Loading failed over SSL
我在 jsp (IBM FileNet JavaViwer) 中嵌入了一个小程序,它将文档加载到 jsp 页面。
小程序通过 http 请求加载正常。
但是使用 https 我遇到了问题。
小程序加载 https 我的开发服务器部署在 WAS 上(没有任何网络服务器)安装了 jre5 或 jre6 的客户端可以完美地查看它。
但是在我的 IHS 服务器位于 WAS 前面的测试环境中,Applet 加载失败并出现 classnot found jre 5 客户端异常。
对于 Jre 6 客户端小程序,也在测试服务器上加载 https。
下面是 Java 控制台日志:
Java Plug-in 1.5.0_15
Using JRE version 1.5.0_15 Java HotSpot(TM) Client VM
User home directory = C:\Users\user1
basic: Cache is enabled
basic: Location: C:\Users\user1\AppData\LocalLow\Sun\Java\Deployment\cache\javapi\v1.0
basic: Maximum size: unlimited
basic: Compression level: 0
basic: Plugin modality.register
----------------------------------------------------
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
p: reload proxy configuration
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>
----------------------------------------------------
basic: Registered modality listener
liveconnect: Invoking JS method: document
liveconnect: Invoking JS method: URL
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@ee6681, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@1fd6bea
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@ee6681, refcount=2
basic: Releasing classloader: sun.plugin.ClassLoaderInfo@ee6681, refcount=1
basic: httpCompression = true
liveconnect: Invoking JS method: execScript
liveconnect: Invoking JS method: evalIntermediateValueToReturn
network: Connecting https://X.X.X.X:443/myApp/FnJavaV1Files/ji.jar with proxy=HTTP @ /Y.Y.Y.Y:8080
network: Connecting https://X.X.X.X:443/myApp/FnJavaV1Files/ji/applet/jiApplet.class with proxy=HTTP @ /Y.Y.Y.Y:8080
network: Connecting https://X.X.X.X:443/myApp/FnJavaV1Files/ji/applet/jiApplet/class.class with proxy=HTTP @ /Y.Y.Y.Y:8080
load: class ji.applet.jiApplet.class not found.
java.lang.ClassNotFoundException: ji.applet.jiApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Exception: java.lang.ClassNotFoundException: ji.applet.jiApplet.class
java.lang.ClassNotFoundException: ji.applet.jiApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Plugin modality.pushed
basic: Modality pushed
basic: push javax.swing.JDialog[dialog0,549,317,268x134,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,262x106,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
basic: Plugin modality.pushed
basic: Modality pushed
basic: push javax.swing.JDialog[dialog0,549,317,422x303,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,416x275,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
basic: Plugin modality.popped
basic: Modality popped
basic: pop javax.swing.JDialog[dialog0,549,317,422x303,invalid,hidden,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,416x275,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
basic: Plugin modality.popped
basic: Modality popped
basic: pop javax.swing.JDialog[dialog0,549,317,422x303,invalid,hidden,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,416x275,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
原来是测试环境的Webserver不支持SSLV3协议。它仅支持 TLSV1。默认情况下,Jre 5 客户端使用 SSLv2Hello 和 SSLv3,因此会抛出错误,因为没有通用协议。然而,jre 6 客户端默认在 SSLv3 和 TLV1 上运行,在这种情况下,TLSV1 是通用协议 btw 客户端和网络服务器并且连接成功并且小程序加载正常。
ClassNotFound 的错误消息虽然很奇怪..
我在 jsp (IBM FileNet JavaViwer) 中嵌入了一个小程序,它将文档加载到 jsp 页面。
小程序通过 http 请求加载正常。
但是使用 https 我遇到了问题。
小程序加载 https 我的开发服务器部署在 WAS 上(没有任何网络服务器)安装了 jre5 或 jre6 的客户端可以完美地查看它。
但是在我的 IHS 服务器位于 WAS 前面的测试环境中,Applet 加载失败并出现 classnot found jre 5 客户端异常。 对于 Jre 6 客户端小程序,也在测试服务器上加载 https。
下面是 Java 控制台日志:
Java Plug-in 1.5.0_15
Using JRE version 1.5.0_15 Java HotSpot(TM) Client VM
User home directory = C:\Users\user1
basic: Cache is enabled
basic: Location: C:\Users\user1\AppData\LocalLow\Sun\Java\Deployment\cache\javapi\v1.0
basic: Maximum size: unlimited
basic: Compression level: 0
basic: Plugin modality.register
----------------------------------------------------
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
p: reload proxy configuration
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>
----------------------------------------------------
basic: Registered modality listener
liveconnect: Invoking JS method: document
liveconnect: Invoking JS method: URL
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@ee6681, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@1fd6bea
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@ee6681, refcount=2
basic: Releasing classloader: sun.plugin.ClassLoaderInfo@ee6681, refcount=1
basic: httpCompression = true
liveconnect: Invoking JS method: execScript
liveconnect: Invoking JS method: evalIntermediateValueToReturn
network: Connecting https://X.X.X.X:443/myApp/FnJavaV1Files/ji.jar with proxy=HTTP @ /Y.Y.Y.Y:8080
network: Connecting https://X.X.X.X:443/myApp/FnJavaV1Files/ji/applet/jiApplet.class with proxy=HTTP @ /Y.Y.Y.Y:8080
network: Connecting https://X.X.X.X:443/myApp/FnJavaV1Files/ji/applet/jiApplet/class.class with proxy=HTTP @ /Y.Y.Y.Y:8080
load: class ji.applet.jiApplet.class not found.
java.lang.ClassNotFoundException: ji.applet.jiApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Exception: java.lang.ClassNotFoundException: ji.applet.jiApplet.class
java.lang.ClassNotFoundException: ji.applet.jiApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Plugin modality.pushed
basic: Modality pushed
basic: push javax.swing.JDialog[dialog0,549,317,268x134,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,262x106,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
basic: Plugin modality.pushed
basic: Modality pushed
basic: push javax.swing.JDialog[dialog0,549,317,422x303,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,416x275,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
basic: Plugin modality.popped
basic: Modality popped
basic: pop javax.swing.JDialog[dialog0,549,317,422x303,invalid,hidden,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,416x275,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
basic: Plugin modality.popped
basic: Modality popped
basic: pop javax.swing.JDialog[dialog0,549,317,422x303,invalid,hidden,layout=java.awt.BorderLayout,modal,title=Error - Java,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,25,416x275,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
原来是测试环境的Webserver不支持SSLV3协议。它仅支持 TLSV1。默认情况下,Jre 5 客户端使用 SSLv2Hello 和 SSLv3,因此会抛出错误,因为没有通用协议。然而,jre 6 客户端默认在 SSLv3 和 TLV1 上运行,在这种情况下,TLSV1 是通用协议 btw 客户端和网络服务器并且连接成功并且小程序加载正常。
ClassNotFound 的错误消息虽然很奇怪..