• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Reflection and magic value

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi man,,
you can try it using DJ Java deCompiler...
or may be corrupted,,,,
bye..
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you so much Ernest Friedman-Hill and all other people.
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic