Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

java bad magic number error  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All, When i'm running configurator executable in the system, I'm getting the bad magic number error and it it coming out, Could some body help me out as how to solve this problem. The error details are as follows:

Starting Configurator run [Date : Wed Aug 1 08:43:59 EDT 2007]

Found executable /opt/java1.4/bin/java
Found executable /usr/bin/dirname
Executing the java code

INTERNAL BRD configurator v 1.2 build 0025
Argument = /home/qa38/brd/apps/config/ File exist and readable
Argument = PD_MF_PRICE_PLAN.xml.v94_r120 File exist and readable
Exception in thread "main" java.lang.ClassFormatError: com/aol/revenue/brd/config/handler/pd_element_id/PD_ELEMENT_ID (Bad magic number)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
Configurator return code: 1
ERROR*** Configurator error

The java installation details on my machine are as follow:

java version ""
Java(TM) 2 Runtime Environment, Standard Edition (build
Java HotSpot(TM) Server VM (build 1.4.1 PA2.0, mixed mode)

Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you are using teh wrong version of Java for the application?

Magic Number, sounds like some sort of prefix in the class file used to identify something, probably a library or JVM version.

Just a random guess, could be totally wrong, but I would check I had the right versions of libraries and JVM's

Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The magic number is always CAFE BABE in hexadecimal. This does not vary between Java versions. If you had the wrong version of Java, you would get a very specific message telling you that. Therefore, you can discount Java version as the reason for your problem.

Here are some things that might be wrong: -

  • You're trying to read, as a class file, a file that was never a class file. Review what you are doing, to see if that could have happened.
  • A class file, or maybe a Jar that it's in, has got corrupted. See whether there's another copy of your software, to compare.
  • Your class file is intended to be read through a special ClassLoader, which does something to the data in the file, before trying to defineClass() with it. This can be associated with security measures. If so, and you legitimately have rights to the class, then consult with appropriate people as to what the security measures are. If you're trying to crack something you don't have rights to, then you deserve to fail - in everything, not just this.

  • [ August 02, 2007: Message edited by: Peter Chase ]
    All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
    RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!