java.lang.ClassFormatError: Incompatible magic value ### in class file ...
807580May 28 2010 — edited Jun 2 2010I'm having a really unusual problem getting a
+java.lang.ClassFormatError: Incompatible magic value ####### in class file any non standard Java class I try+
when XMLEncoding values from an Applet. The process is that when the Applet wants to save its data, it persists a POJO Java Bean across the wire to a Servlet that simply dumps the XMLEncoded data into the DB. Just this morning, everything was working just fine, but now, there seems to be something mysteriously wrong with ANY class I try to XMLEncode from the Applet running within a browser, and it seems to be any browser (IE, Safari, FF, Chrome, Opera).
I have no problem XMLEncoding the values from a stand-alone program, nor XMLEncoding the values when the applet is running under development (that is, right out of Eclipse within the applet viewer). However, once compiled into the JAR file and loaded and executed from a local Apache server on the exact same machine, I start getting the error.
I thought this might be due to different versions of JAR files between Eclipse and the applet, so that has been checked and verified now so many times I cannot count it.
The one thing consistent in the exception is that it is looking for a classNameBeanInfo class*. This morning and for the past 3 months we've had no such problems, but starting today, the problem began when we were making unrelated changes to the Applet. We haven't made changes in about a month.
So, if I have a class "FooBar", the XMLEncoder is complaining about the magic value for "FooBarBeanInfo"... and in no cases have we ever developed BeanInfo classes, and before now, everything has been OK. Again, this happens on all custom classes, and does not happen on standard Java classes, such as a String.
The system is running Java "1.6.0_13", and Eclipse is compiling with that JDK as well. The JRE is "1.6.0_20"
I'm totally lost here. Any ideas are appreciated.