Working with the dnsjava library, I've encountered a frustrating and confusing problem where I can call Type.A
properly but calling Type.value(str)
throws a java.lang.NoClassDefFoundError
.
System.out.println(org.xbill.DNS.Type.A); // works
if (org.xbill.DNS.Type.value(type) == -1) { // throws NoClassDefFoundError
/* logic */
}
This code is being executed from a jar
and other classes in the jar use the library correctly.
Why and how could this be happening? How can I debug this further?
Thanks!
EDIT
Jon Skeet was correct. A friend showed me how to use javap -c
and I changed the value to something more distinct, Type.AAAA, which has a value of 28:
878: getstatic #116; //Field java/lang/System.out:Ljava/io/PrintStream;
881: bipush 28