Link to home
Start Free TrialLog in
Avatar of tmflores
tmflores

asked on

How to troubleshoot a Java exeption error for java.lan.ClassFormatError: Unknown constant tag 0 in class file

When I try starting a particular Java based program that was recently upgraded, it gives me an error which says: An exception occured in the JVM. Detail - java.lang.ClassFormatError: Unknown constant tag 0 in class file sun/awt/image/FetcherInfo. Then below it is another error that says: Failed calling Java method! Method name: main. Can someone please explain to me how to go about troubleshooting this?
JavaError.jpg
ASKER CERTIFIED SOLUTION
Avatar of sciuriware
sciuriware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tmflores
tmflores

ASKER

ok. but how do I find the FetcherInfo .class to fix it?
nm I found it. now, would it be possible to replace that particular .class file with a known good one?
If you obtain a clean JRE, and unpack the JAR where all the runtime classes are stored in (typically rt.jar), you'll get a clean copy of the FetcherInfo class. The first thing I would do then is to do a binary compare of the two files. If the two are identical, then you're probably dealing with a bytecode modification issue AFTER the clean FetcherInfo gets loaded into the JVM... so basically looking at externally stored classes is not going to get your anywhere.

If the binary diff does give you a difference, could you please post the first 16 bytes of both files. The header contains .class file version information, and you may have an issue there too.

the effected FetcherInfo.class will not open. when I try to decompile it I get the attached error so I can't (or don't know how to) compare the binary of each FetcherInfo.class.

Any suggestions?
FetcherInfo-decompile-error.doc
OK, for now, I would concentrate on seeing a hexdump diff of the two files. Forget the buggy decompiler that you used. So a) produce hexdumps of the two files, then b) use a diff program to produce a diff output.

Like I said, the very first you need to establish is whether the two files are identical or not. If they differ, then it's a question of "what differs" ?

HTH
I was able to get the error to go away by just replacing the entire rt.jar file with a known good. Thank you for your assistance.