Hi,
After I upgraded my machine to JRE 1.6 Update 16, I now get the following error trying to load the
ShellExplorerApplet sample applet.
This could be an issue in the Sun update code, but I wanted to make sure you were aware of it.
thanks,
Andrew Regier
Perceptive Software
Java Plug-in 1.6.0_16
Using JRE version 1.6.0_16-b01 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Administrator
----------------------------------------------------
ENTER: ShellExplorerApplet.init()
Exception in thread "thread applet-ShellExplorerApplet.class-1" java.lang.NoClassDefFoundError: com/jniwrapper/win32/z
at com.jniwrapper.win32.automation.OleContainer.<init>(SourceFile:81)
at com.jniwrapper.win32.automation.OleContainer.<init>(SourceFile:100)
at ShellExplorerApplet.init(ShellExplorerApplet.java:44)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.jniwrapper.win32.z
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 5 more
Caused by: java.io.IOException: open HTTP connection failed:http://<machine>:8000/comfyJ_sample/com/jniwrapper/win32/z.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Hi Andrew,
Thank you for this information. We will investigate this problem deeper and let you know the result.
Hi Andrew,
I am not sure that this issue is related somehow to that JRE 1.6 Update 16, because according to the exception, the cause is "ClassNotFoundException: com.jniwrapper.win32.z" which indicates that the required class (probably from JNIWrapper library) is not found in the applet class path. Please make sure that all required libraries are included into the class path.
If the problem persists please send us the complete sample that reproduces the issue. We will investigate it and let you know the solution.
-Serge
Hi Serge,
thanks for your reply.
The sample application I saw this in was ComfyJ\samples\Applets\src\ShellExplorerApplet.java. (from the .zip install package)
I already have sample.jar, comfyj-2.6.jar, jniwrap-3.7.2.jar, and winpack-3.7.jar available on the path.
It has to be run through an application server like Tomcat to see the issue.
If you set it up so that it is working using JRE 1.6 Update 13 and then upgrade to Update 16,
it should break and show you the same stack trace I saw.
Again, this certainly could be a Sun issue -- I just wanted to make sure you were aware of it.
thanks,
Andrew Regier
Perceptive Software
Complete sample replication steps:
1. download ComfyJ package ("comfyj-2.7-windows-32_64-bit.zip" from your website)
2. Place comfyj.lic and jniwrap.lic licenses inside the bin folder
3. In samples\Applets, run "ant" (build.xml) with a valid signing key
4. Edit/Fix ShellExplorerSample.html
Change
<p><applet code="ShellExplorerApplet.class" width="800" height="600" archive="sample.jar,../../lib/jniwrap-3.8.jar,../../lib/comfyj-2.7.jar,../../lib/winpack-3.8.jar"/>
to
<p><applet code="ShellExplorerApplet.class" width="800" height="600" archive="sample.jar,../../lib/jniwrap-3.8.jar,../../lib/comfyj-2.7.jar,../../lib/winpack-3.8.jar,../../lib/slf4j-api-1.5.8.jar,../../lib/slf4j-simple-1.5.8.jar"/>
5. Double-click ShellExplorerSample.html
Running these steps on JRE 1.5u17 loads the google homepage as designed.
Running these steps on JRE 1.6u16 yields the following error:
Exception in thread "thread applet-ShellExplorerApplet.class-1" java.lang.NoClassDefFoundError: com/jniwrapper/win32/bq
at ShellExplorerApplet.init(ShellExplorerApplet.java:43)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.jniwrapper.win32.bq
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 3 more
Caused by: java.io.FileNotFoundException: E:\Archive\TeamDev\comfyj-2.7-windows-32_64-bit\samples\Applets\com\jniwrapper\win32\bq.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
All the required classes are there in the classpath.
It looks like you are overriding the default class loading behavior (com.jniwrapper.win32.ap extends URLClassLoader).
You may inadvertantly be depending on specific JRE code by doing so.
We *really* need this fixed -- Many of our customers will be using JRE 1.6u16 and greater.
Hi Andrew,
Thanks for the update. We are investigating this issue and I will let you know the solution soon.
-Serge
Hi Andrew,
We have investigated the issue with IOException in applets under Java 1.6.0_16 in details and here are our findings.
We found out that the issue is reproducible with Java versions 1.6.0_15 through 1.6.0_17. It is not reproducible with versions earlier version up to 1.6.0_14, and with all greater versions, starting from 1.6.0_18 and 1.7.0.
The stack trace indicates that Java is looking for the classes in a local directory that consist of applet codebase and package path, completely ignoring archive:
Caused by: java.io.FileNotFoundException: E:\Archive\TeamDev\comfyj-2.7-windows-32_64-bit\samples\Applets\com\jniwrapper\win32\bq.class (The system cannot find the path specified)
where "E:\Archive\TeamDev\comfyj-2.7-windows-32_64-bit\samples\Applets\" is codebase and "com\jniwrapper\win32" package path. Which means that in case of local run JWS supposes that all JAR files are being cashed already. There were known caching issues under Java 1.6. We suppose that such behavior could be caused by Sun's fix of jar decompression algorithm (http://sunsolve.sun.com/search/document.do?assetkey=1-66-263488-1). Therefore we sure that the problem is caused by a specific Java version rather than by our product.
It should be also mentioned that this issue is never observed if you run your applet via HTTP, but not from a local directory. We managed to start the applet even with 1.6.0_15 by running it under Apache web server with home directory set to the folder containing applet sample ([ComfyJ_Home]\Samples\Applets).
To solve this issue please recommend your customers to upgrade Java to version 1.6.0_18 or higher. And in cases when it's not possible please avoid opening Applets by running them from a local folder directly.
Please let us know if you have any further questions.
-Serge