Meaningless Drivel is fun!
The moose likes Applets and the fly likes Incompatible magic value, ahem ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Incompatible magic value, ahem ?" Watch "Incompatible magic value, ahem ?" New topic

Incompatible magic value, ahem ?

Morten Frost

Joined: Oct 02, 2006
Posts: 1
Hey there

I have stumpled upon a problem I have never encountered before.
It has to do with the execution of an Applet.

I have three .jars:
- a.jar (The actual testing applet)
- commons-logging-api.jar
- jmimemagic-0.1.0.jar

commons-logging-api.jar and jmimemagic-0.1.0.jar are external libraries which is used throughout the main applet code. I have placed these libraries on a webserver, and link directly to them at their server location in the applet "archive" attribute. (archive="a.jar,http://....../jmimemagic-0.1.0.jar, http://....../commons-logging-api.jar).

If I run the applet locally, everything executes as expected, but once I move "a.jar" to the server aswell, I receive this weird error: "Incompatible magic value".

Stacktrace follows:
Exception in thread "Thread-1989" java.lang.ClassFormatError: Incompatible magic value 537528842 in class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at Source)
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 org.apache.commons.logging.LogFactory$
at Method)
at org.apache.commons.logging.LogFactory.newFactory(
at org.apache.commons.logging.LogFactory.getFactory(
at org.apache.commons.logging.LogFactory.getLog(
at net.sf.jmimemagic.Magic.<clinit>(

Any help would be much appreciated.

Meghna Bhardwaj
Ranch Hand

Joined: Jun 08, 2007
Posts: 109

I realize this is an old issues however, I just ahd the same problem and wanted to post a reply so it might help others who are experienceing this.

I had 2 versions of Java installed 1.4 and 1.6 and was getting this error about java.lang.ClassFormatError: Incompatible magic value

I just uninstalled Java 1.4 from Start->Control panel-> Add/remove programs and restarted my machine. The error went away instantly.

I agree. Here's the link:
subject: Incompatible magic value, ahem ?
It's not a secret anymore!