• Post Reply Bookmark Topic Watch Topic
  • New Topic

Incompatible magic value, ahem ?

 
Morten Frost
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there

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

Now...
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 java.security.SecureClassLoader.defineClass(Unknown 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$2.run(LogFactory.java:571)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:332)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
at net.sf.jmimemagic.Magic.<clinit>(Magic.java:46)

Any help would be much appreciated.

Regards,
Morten
 
Meghna Bhardwaj
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Regards.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!