• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection and magic value  RSS feed

 
achayya matta
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,
I am working on a project called eVAS,basically it is a web application,developed by someone else.

I have source for each and every class, except one class called "dk.class".

when i tried to see whats inside that class using reflection mechanism, i got the following error message.

Exception in thread "main" java.lang.ClassFormatError: Incompatible magic valu
-1393754107 in class file dk
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at ShowMethods.main(ShowMethods.java:16)


ranchers please help me why this error is coming.

Than in advance to each and every rancher
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like a corrupted file, or something that's simply not a class file. Every class file starts with the magic number 0xCAFEBABE in hexadecimal; your file starts with 0xACED0005 (the hex version of the number in the error message) so it's clearly not a class file as-is.

Do you see the class "dk" being used in your source anywhere? I'd assume not.

Perhaps this file is just leftover garbage, or perhaps it's some other kind of file that's loaded using Class.getResource() -- or maybe an encrypted class file that's loaded using getResource() and then decrypted. Search your source code and see if the file is referenced anywhere.
 
Alan Hermin
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi man,,
you can try it using DJ Java deCompiler...
or may be corrupted,,,,
bye..
 
Jaime M. Tovar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to open the class file with something like VI editor. Normally even class files have method names and stuff you can read. If it is just binary data maybe it is a resource shadowed as a class file. One time I found a guy created a clean txt file with the database passwords and named it .class to make it �difficult� to hack.
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jaime Tovar:
Try to open the class file with something like VI editor. Normally even class files have method names and stuff you can read. If it is just binary data maybe it is a resource shadowed as a class file. One time I found a guy created a clean txt file with the database passwords and named it .class to make it �difficult� to hack.


I lol'd.
 
achayya matta
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you so much Ernest Friedman-Hill and all other people.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!