tags:

views:

1116

answers:

4

Some users are complaining that the applet no longer works, When they view the java console they are greeted with a java.lang.noClassDefFoundError and checking my access log's I see they have downloaded the jar file that contains the class, and then issue a get request for the particular class.

Different users break on different classes.

Some users are fine.

Any ideas what could cause this/fix this.

I have checked to make sure the file is in their java cache, cleared the cache etc. nothing seems to fix them.

If they hit a qa site it breaks as well.

A: 

Are you sure the jar file contains all the necessary classes? Open it up in your favorite Zip application and double check. Maybe a recent build of that jar got messed up and doesn't have everything in it.

Herms
+1  A: 

This can occur if the class itself can be loaded but some dependency of that class cannot be. Are there external JARs that are dependencies?

Eddie
no only the four jars that are downloaded.
Tristan
This answer may not apply to this question, but it was the answer to a problem I am having. Thanks @Eddie!
A. Levy
A: 

I'm assuming that you have made some updates by your wording. It is highly likely that some users have a previous Jar file cached.

When deploying a new applet version in a live configuration I perform the following:

  1. Ensure the page holding the applet is not cached - use HTTP no-caching techniques. You may want to redeploy from a new page with these headers to ensure that it's not the case.
  2. Deploy the jar file from a different URL for each update (I encode the version number in a directory, but you can equally rename the jar file).
  3. If applet performs any client server interaction ensure that you check version numbers and report incorrect version to the user.

Even if you follow this the user may still have a problem, ask them to try these one at a time (listed in order they should try):

  1. Press refresh on the browser window.
  2. Restart all browser windows
  3. Uninstall all Java VMs found on "Add/Remove programmes" and reinstall latest Java (yes, they must do this at their own risk!)
Pool
nope same jar's no updates. I have made the clients clear their cache and redownload the jars (i love 56k!) and still nothing.I have gotten them to uninstall all java's, (1.6.0_03) and reinstall. Nothing. One client found that when he uninstalled, rebooted, reinstalled it worked once.
Tristan
(ie resolved class files from the jars) and any time after that the JRE would not load the class file from the jar and would try and obtain it from the server which results in a 404 and then the JRE bombs with a NoClassDefFoundError.And that only worked on one pc, the rest would always fail.
Tristan
Can you post the full stack trace of the error?
Pool
load: class com.bankframe.foo.launch.manager.FooApplet.class not found.java.lang.ClassNotFoundException: com.bankframe.foo.launch.manager.FooApplet.class at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source)
Tristan
at java.lang.ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unk
Tristan
Caused by: java.io.IOException: open HTTP connection failed:http://10.103.113.127:7200/applications/com/bankframe/foo/launch/manager/FooApplet/class.class at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
Tristan
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 7 moreException: java.lang.ClassNotFoundException: com.bankframe.foo.launch.manager.FooApplet.class
Tristan
names have been changed from foo to protect the guilty :-)
Tristan
I suspect the problem is with your HTML tag. I specify "com.company.Applet" not "com.company.Applet.class" in my code. Which tag do you use, Applet, Object or Embed?
Pool
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"WIDTH=851 HEIGHT=571 align="left"> <PARAM NAME=CODEBASE VALUE=./applications > <PARAM NAME=ARCHIVE VALUE="framework.jar, foo_ext.jar, foo_gui.jar, foo_int.jar" >
Tristan
<PARAM NAME=CODE VALUE = com.bankframe.Foo.launch.manager.FooApplet.class > <PARAM NAME="type" VALUE="application/x-java-applet;version=1.4.2_04"><COMMENT> <EMBED type="application/x-java-applet;version=1.4.2" java_CODE = com.bankframe.foo.launch.manager.FooApplet.class
Tristan
ARCHIVE="framework.jar, foo_ext.jar, foo_gui.jar, foo_int.jar" CODEBASE=./applications WIDTH=851 HEIGHT=571 align="left"> <NOEMBED></COMMENT> </NOEMBED> </EMBED> </OBJECT>
Tristan
the html is ugly, but has worked for 6 years.
Tristan
You should ensure all your parameters are quoted, especially the code. <PARAM NAME=CODE VALUE = com.bankframe.Foo.launch.manager.FooApplet.class > to <param name="code" value="com.bankframe.Foo.launch.manager.FooApplet.class">
Pool
It's also worth running your HTML through the W3 validator at http://validator.w3.org. Do you know if the failure is browser/OS dependent
Pool
it seems to be intermittent at best...turning the logging to all on the java console yieldsjava.io.EOFException: Unexpected end of ZLIB input stream at java.util.zip.InflaterInputStream.fill(Unknown Source) at java.util.zip.InflaterInputStream.read(Unknown Source) at
Tristan
this may be related http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4040920
Tristan
Possibly a problem with the Jar creation?
Pool
appears weblogic 7sp7 is corrupting the jar filesswitching weblogic7sp2 seems to fix it
Tristan
+2  A: 

The jar is getting corrupted in transit, We are looking at getting patches from oracle/bea for the server.

It appears that if a connection is too slow (Modem speeds) that weblogic will signal the end of a transfer by sending a packet with len=0.

The network will signal java saying the download completed successfully and then java fails with a java.lang.noClassDefFoundError.

Tristan
Hi, I think I'm encountering a similar problem, can you give me any details on the patches from oracle/bea?
Roy Tang
sorry to take so long...CR196369 and CR317020 I think the issue was that the default timeout got changed from seconds to ms. so the previous sane value of 50 became not so sane.
Tristan