File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

incompatible magic value

 
William Stafford
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I developed an app on my local machine. I was able to run it from Eclipse with no errors.

The app was ported to another machine. When attempting to start the app the following message is displayed:
Exception in thread "main" java.lang.ClassFormatError: Incompatible magic value 4022320623 in class file BatchInsert

I thought this sort of thing was a version incompatibility but the class file is being built with Java 1.5 and the target machine is Java 1.6.

I have looked at a lot of postings about this problem and have not seen a clear cause or cure except in the case of downloaded files which are supposed to be class or jar files but are not.

Any help or guidance would be appreciated,
-=beeky
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A bad magic number basically means that the file isn't a Java class file, or it has been corrupted.

How did the "port" happen?
 
William Stafford
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ilja,
Thanks for answering my question. I hope great minds think alike because I started looking at the 'port' immediately after I posted my question.

The port was done with an Ant script. The port task had filtering="true" for the copy of the class files. Who knows what kind sort of damage was done to the class files by this.

I changed the port to copy the class files without filtering and the problem went away.

Thanks again for taking the time to answer my question,
-=beeky
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic