是什么原因导致“java.lang.InknownClassChangeError:vtable存根”?

发布于 2024-09-05 20:04:11 字数 515 浏览 7 评论 0原文

是什么原因导致“java.lang.InknownClassChangeError:vtable存根”?在我们的应用程序中,我们很少看到此错误随机弹出(到目前为止只出现两次,而且我们运行了很多次)。即使重新启动应用程序,使用相同的 jvm/jar 而不重建,它也不容易重现。

至于我们的构建过程,我们清理所有类/jar 并重建它们,因此这与其他人遇到的问题不同,他们在一个类中进行了更改并且没有重新编译其他一些依赖类。

这与与 IncompleteClassChangeError 相关的其他一些问题不同——它们都没有提到“vtable 存根”。事实上,当搜索“IncompleteClassChangeError“vtablestub””时,谷歌结果出人意料地少。

编辑:

  • 使用 JDK 1.6.0_16。
  • 我们没有使用 Java 序列化。
  • 我们不进行字节码操作。
  • 如前所述,我们正在进行“干净构建”,因此以前的构建中没有遗留任何类。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

娇俏 2024-09-12 20:04:11

JVM 字节码世界中的 API 损坏。查找 Javadoc

当某些类定义发生不兼容的类更改时抛出。当前执行的方法所依赖的某些类的定义已发生更改。

要查找的罪魁祸首是对静态最终文字值的更改,因为这些值会作为“优化”复制到字节代码中。

编辑:这可以像库升级的结果一样简单,我知道的唯一修复是干净的重建。

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.

思慕 2024-09-12 20:04:11

看起来您已经更改了类定义(即添加额外的属性或更奇怪的东西),并且在运行以前使用的对象时变得不兼容。

也许您将对象实例存储在某个地方(数据库文件系统),然后这些旧对象定义被解组,就会发生错误。

这件事过去发生在我身上。

例如:

class Employee implements Serialiable {
   String name;
   String lastName;
   String address;
   ... etc 
}

应用程序运行了几周,一些对象以其序列化版本存储在文件系统中。

后来由于应用程序发生更改,我们必须将地址添加为对象:

class Employee implements Serializable {
   String name;
   String lastName;
   Address address;
 }

然后重新构建之前存储的对象,并尝试使它们适合这个新的描述,该错误可能< /strong> raise (就我而言,它比这复杂得多),但它可能会帮助您朝那个方向看。

Looks like you have changed the class definition ( ie adding an extra attribute or something more weird ) and when running your previously used objects become incompatible.

Perhaps you're storing object instances somewhere ( a db the filesystem ) and then those old objects definition are unmarshalled, the error occurs.

It happened to me in the past.

For instance:

class Employee implements Serialiable {
   String name;
   String lastName;
   String address;
   ... etc 
}

The application works for a couple of weeks and some objects are stored in the filesystem in its serialized version.

Later due an application change we have to add the address as an object:

class Employee implements Serializable {
   String name;
   String lastName;
   Address address;
 }

Then the previously stored objects are reconstituted and an attempt is made to make them fit in this new description, that error may raise ( in my case it was much more complex than this ) but it may help you to look in that direction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文