Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes "java.lang.IncompatibleClassChangeError: vtable stub"?

What causes "java.lang.IncompatibleClassChangeError: vtable stub"? In our application, we have seen this error pop up randomly and very seldom (just twice so far, and we run it a lot). It is not readily reproducible, even when restarting the app, using the same jvm/jars without rebuilding.

As for our build process, we clean all classes/jars and rebuild them, so it's not the same problem as others have encountered where they made a change in one class and didn't recompile some other dependent classes.

This is unlike some of the other questions related to IncompatibleClassChangeError -- none of them mention "vtable stub". In fact, there are surprisingly few google results when searching for "IncompatibleClassChangeError "vtable stub"".

Edit:

  • Using JDK 1.6.0_16.
  • We are not using Java serialization.
  • We are not doing bytecode manipulation.
  • As mentioned earlier, we are doing a "clean build", so there are no classes left over from a previous build.
like image 767
JimN Avatar asked Nov 05 '22 12:11

JimN


1 Answers

API breakage in the JVM byte-code world. Look up the Javadoc:

Thrown when an incompatible class change has occurred to some class definition. The definition of some class, on which the currently executing method depends, has since changed.

Culprits to look for would be changes to static final literal values because these get copied around in the byte code as “optimization”.

EDIT: This can be as simple as the result of a library upgrade, the only fix I know of is a clean rebuild.

like image 70
user268396 Avatar answered Nov 12 '22 20:11

user268396