I am getting a NoSuchFieldError in my code, now oracle isn't very clear about why this error is thrown only saying: this error can only occur at run time if the definition of a class has incompatibly changed.
Can someone explain to me how one could 'incompatibly change' a class? The class I am talking about extends quite allot of classes so I suspect it might have to do with that but I don't know where to start looking or what I'm looking for.
This error is typically thrown if you only partially recompile your code. You've got old code that is referencing a field that no longer exists in the recompiled class files.
The solution is to clean out all the class files and compile everything from fresh.
Update: If you still get the same error after recompiling everything, then you're probably compiling against one version of an external library and using another at runtime.
What you need to do now is first identify the class that is causing the problem (it looks like you have done this already) and then run your application with the -verbose:class
command line option. It will dump a lot of class loading information on your standard out and you'll be able to find out where the problematic class is exactly loaded from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With