Applets and Java plugin2 issue with Java (>=1.6.0_15)

ChemAxon 5433b8e56b

24-09-2009 12:12:19

ChemAxon found a serious incompatibility issue between Marvin Applets and the Next Generation Java plugin (also known as plugin2 introduced in Java 1.6.0_10) with 1.6.0_15 and higher versions: Sometimes, when an applet is restarted a NoClassDefFoundError is thrown.

Details:
If the classes of a package are separated into two or more jar files, and the applet is restarted before all the classes of a package are downloaded into the cache, then upon downloading a jar that contains another class of the source package, this class will not be found in the downloaded resources and a NoClassDefFoundError is thrown from AppletClassLoader.

The cause of the error:
The AppletClassloader discovers the ClassPath and downloads the jar which contains the class, and after the new jar is downloaded the AppletClassLoader tries to load the class but fails. The fallback mechanism then tries to load the class file from the codebase of the applet, but there are no class files in the codebase, so an error is raised.

Since inside Marvin we have packages for applets that are separated into more jars (for different reasons) this affects the Marvin code deeply and it is hard to redesign it quickly.

A complete bug report has already been posted to Sun, and we are now trying to identify where this issue should be fixed. Until the final solution is achived, we suggest to use one of the following two workarounds:
1. The latest Java version installed on the computer where the applet is used should not be newer than 1.6.0_14
2. On the computer where the applet is used the Next Generation Java Plugin should be disabled. It can be made by switching the corresponding checkbox to off in the Java Control Panel's Advanced tab in the "Java Plugin" section.
Both of these workarounds need administrator privileges on the computer.

We are really sorry for any inconvenience caused by this issue. We will notify you in this topic if we have any further information.
Should you have any questions related to this issue please do not hesitate to ask us in this topic.

The Support Team

ChemAxon 5433b8e56b

06-10-2009 13:08:35

Sun has dispatched our bug report in their bug database.


Our bug reports can be found at:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6888527 />http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6888528


 

User 98d11041ad

17-11-2009 22:22:02

The same issue has been observed on IE 7 and IE 8 with Sun plugins version 1.6.0_16


 


Are there any estimates for a fix?

User 98d11041ad

17-11-2009 22:31:01

To whom it may concern,


 


The two bugs reports form the links above are closed as not reproducible on Verision 1.6.0_18 which is not currently available fo download form http://java.sun.com/javase/downloads/index.jsp. The latest JRE available is update Java 6 update 17.

User 98d11041ad

18-11-2009 00:42:16

After updating to Java 6 update 17 the issue persists on IE 7 and 8.

ChemAxon 5433b8e56b

18-11-2009 05:35:04

Yes unfortunatelly they can not reproduce the bug, because they trying with class files next to the jar files, and in this way the security exception they got is normal. It seemed to me they have not tried with only the jar files.


In the sun developer comment of the bug, was only one thing i have not tried ever, i have never enumerated all the jar files for the codebase property since this list have to take place in the manifest of the main jar as the ClassPath. After the suggestion, i have tried this, but nothing happens, and the problem persist with enumerated jars also.


I have tested this with an early access build of 1.6.0_18 and the problem is persist with that too.


I would rahter not give estimations since we are not absolutely sure about the root of the problem, so currently we do not have any plan on how to fix this.


The only thing i can tell is that, now we are concentrating on the last fixes for the feature set of Marvin and Jchem 5.3 release, after the release is out, we will investigate further possibilities on this class loading problem.

ChemAxon 5433b8e56b

04-03-2010 17:20:10

For a few
weeks we have tried to reinvestigate this issue, but experienced that the
issue had disappeared. Neither with our applets nor with the test applet I have
created before were we able to reproduce the issue. We have the
suspicion that it is somehow related to environmental issues, other software,
some system cache, or other cache that had been changed and the issue is solved
by the change, but currently it seems everything is working fine.

We believe it is safe to upgrade to newer java versions. If you run into the described issue after
upgrading, please inform us. Maybe this way we can finally figure out the
root cause of the problem.



The Support Team

User 7a91625cbd

30-03-2010 07:34:21

I have the same problem.


When I try to draw other than naphtalene from the below icon box, or access other functions such as "Clean in 2-D", I got the follwing error:


java.lang.NoClassDefFoundError: Could not initialize class chemaxon.marvin.modules.GraphInvariants



The error does not occur, when I turn off the cache or at the first time after I cleaned my cache. In your example site (e.g. https://www.chemaxon.com/marvin/examples/applets/view/embed.html), there's no problem. Is this related to setup? I'm using apache web server running in linux box and testing applet in windows with IE6, IE8, Chrome browser. The version of java is 1.6.0_18-b07.





Only the difference between chemaxon site and mine is the version of applet which is showing in Help>About. I'm using 5.3.1 built at 2010-02-23 while the chemaxon sites using 5.3.1 built at 2010-02-22, one day earlier.


Thanks in advance. (and sorry for my poor english.)

ChemAxon 5433b8e56b

31-03-2010 12:47:36

Hi,


would you please confirm that the applet-path/chemaxon/isotopes.data is accessible on your server?


Regards,
Istvan

User 7a91625cbd

01-04-2010 00:09:07

Thanks for your reply.


I can download that file from client without problem.


The errors (other than 200, or 304 response code) I can find in the apache web server's log is as follows :


"GET /applets/marvin/chemaxon/license.cxl HTTP/1.1" 404 318 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/dict.class HTTP/1.1" 404 324 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/plugins/plugins.properties HTTP/1.1" 404 324 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"HEAD /applets/marvin/marvin.mytemplates HTTP/1.1" 404 - "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"HEAD /applets/marvin/marvin.mytemplates HTTP/1.1" 404 - "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/sketch/swing/actions/ZoomModel_ko.class HTTP/1.1" 404 353 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/sketch/swing/actions/ZoomModel_ko.properties HTTP/1.1" 404 358 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/sketch/swing/actions/ZoomModel_ko_KR.class HTTP/1.1" 404 356 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/sketch/swing/actions/ZoomModel_ko_KR.properties HTTP/1.1" 404 361 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/swing/modules/SaveImageFileChoose_ko.class HTTP/1.1" 404 356 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/swing/modules/SaveImageFileChoose_ko.properties HTTP/1.1" 404 361 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/swing/modules/SaveImageFileChoose_ko_KR.class HTTP/1.1" 404 359 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


"GET /applets/marvin/chemaxon/marvin/swing/modules/SaveImageFileChoose_ko_KR.properties HTTP/1.1" 404 364 "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_18"


I don't have chemaxon/marvin/{sketch,swing} diretories. What I did when I install the applet is to extract the marvin-bin-5_3_01.tar.gz and I changed the permission of all the files and directories so that the web server can read all of them.


Is this normal? or should I setup some properties?



Thanks.

ChemAxon 7c2d26e5cf

01-04-2010 17:58:52

You have installed Marvin Applets package correctly.


The chemaxon/marvin/{sketch|view} directory does not present in the directory hierarchy of the archive files. Those resources that are located in these packages are wrapped into jar files.
But in this case, Java seek for optional files (that can present in the above folders). Lack of these files does not cause any restriction in the usage. Marvin does not require the present of these files.

User 870ab5b546

05-04-2010 00:10:21

I am suddenly getting a ClassNotFoundException since I downgraded from Marvin 5.3.1 to Marvin 5.2.3. I am using Safari 4.0.5 on MacOS 10.5.8, Java 1.6.0_17. However, if I go to your Web site and look at Marvin 5.3.1, it starts up fine. Also, on another computer running Safari 4.0.5 on MacOS 10.4.11, Java 1.5.0, Marvin 5.2.3 loads fine.


Is Marvin 5.3.1 immune to the problems that you describe above?

User 870ab5b546

05-04-2010 13:12:52


I've managed to isolate the problem even more.


On my MacOS 10.5.8 desktop, Safari 4.0.5, "java -version" shows Java 1.5.0_22 but it also has Java 1.6 loaded, all software updates loaded:


http://epoch.chem.uky.edu/epoch-plugin/public/mechmarvin.jsp: Marvin loads.


http://128.163.140.67:9080/epoch-plugin/public/mechmarvin.jsp: Marvin doesn't load, and the Java console shows:


load: class JMSketchLaunch not found.
java.lang.ClassNotFoundException: JMSketchLaunch
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:145)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:667)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:723)
at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1873)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:652)
at sun.applet.AppletPanel.run(AppletPanel.java:326)
at java.lang.Thread.run(Thread.java:613)

If I switch the latter site to Marvin 5.3.1, it loads fine.


One difference between the two sites is that the first site runs Tomcat 5 and Java 1.5.0_02, and the second runs Tomcat 6 and Java 1.6.0_0.  


Neither site is protected, so you can go there and see what you can learn.


-- Bob

ChemAxon 7c2d26e5cf

06-04-2010 09:26:28

I guess it can be a caching problem.


Earlier used Marvin 5.3.1 from your site may be preserved in your cache. Probably your browser still prefer cached jars when you visit to your site, instead of downloading the 5.2.3 resources from the updated site.


I recommend to delete Java cache. I hope it solves the problem.

User 870ab5b546

06-04-2010 12:36:38

No, I already deleted the Java cache, the browser cache, and the classloading cache.  No joy.


I also tried unchecking the Java 6 box in Java Preferences, given that my home desktop (MacOS 10.4.11), which has only through Java 1.5, is not displaying the same problems.  Again, no joy.

User 7a91625cbd

08-04-2010 07:19:55

Finally, I tracked down the problem, and the problem is starting from the following error. Of course, I'm sure that the installed `isotopes.data` file is original as was in the package and I can uncompress it using gunzip in linux.


java.io.IOException: Not in GZIP format
at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
at java.util.zip.GZIPInputStream.<init>(Unknown Source)
at java.util.zip.GZIPInputStream.<init>(Unknown Source)
at chemaxon.struc.PeriodicSystem$IsotopeDataHolder.a(Unknown Source)
at chemaxon.struc.PeriodicSystem$IsotopeDataHolder.<clinit>(Unknown Source)
at chemaxon.struc.PeriodicSystem.a(Unknown Source)
at chemaxon.struc.MolAtom.isotopeType(Unknown Source)
at chemaxon.marvin.modules.GraphInvariants.<clinit>(Unknown Source)
[.. snip ..]

Anyway, the problem is caused when uncompress cached `isotopes.data` and if I delete the cached file -- only isotopes.data -- at java control panel, the applet is loaded correctly at the next time.


So, I tried to control cache header for .data file using .htaccess in apache as a workaround for this problem. I made a ".htaccess" file in "marvin-applet/chemaxon" directory with content as follows:


<FilesMatch "\.(data)$">
FileETag None
<IfModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</IfModule>
</FilesMatch>

Now, the applet loads correctly every time.

ChemAxon 7c2d26e5cf

08-04-2010 17:35:55

Please do not uncompress isotopes.data Marvin expects the compressed file.


By the way, we plan to eliminate isotopes.data and provides isotopes in another format.