java.lang.VerifyError: JVMVRFY012 堆栈形状不一致;

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32821759/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 20:49:54  来源:igfitidea点击:

java.lang.VerifyError: JVMVRFY012 stack shape inconsistent;

javawebspherejava-7ibm-was

提问by Pavan Rao

I am getting the following error while deploying a Maven project in WAS 8.5.5.

在 WAS 8.5.5 中部署 Maven 项目时出现以下错误。

I have installed JDK 1.6 and 1.7 in WAS.

我已经在 WAS 中安装了 JDK 1.6 和 1.7。

Error 500: org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=com/xyz/simtools/savings/jaxb/SavingsInput_JAXB_Deserialization_Stub, method=write(ILjava/lang/Object;)V, pc=356

错误 500:org.springframework.web.util.NestedServletException:处理程序处理失败;嵌套异常是 java.lang.VerifyError: JVMVRFY012 堆栈形状不一致;class=com/xyz/simtools/savings/jaxb/SavingsInput_JAXB_Deserialization_Stub,method=write(ILjava/lang/Object;)V,pc=356

Things I noticed:

我注意到的事情:

  1. In Tomcat, it's working fine
  2. There was some fix for this in IBM JDK according to thisbut it is still not working for me
  1. 在Tomcat中,它工作正常
  2. 有一些修正,根据该在IBM JDK这个,但它仍然不是对我来说有效

Things I tried:

我尝试过的事情:

  1. Tried with both JDK versions in WAS.
  2. Read this linkin IBM Forum
  3. Compiled my project in 1.5 and 1.7 and tried deploying
  1. 在 WAS 中尝试了两个 JDK 版本。
  2. 阅读IBM 论坛中的此链接
  3. 在 1.5 和 1.7 中编译我的项目并尝试部署

Am I missing something? Any other changes which I need to take care of?

我错过了什么吗?我需要注意的任何其他变化?

采纳答案by Ualter Jr.

I had the same issue, but in my case the problem and the fix was a different thing.

我遇到了同样的问题,但在我的情况下,问题和修复是另一回事。

(Possible) cause:My verdict regarding the cause of the problem was the conflict between two version implementations of the same API. At the design time, at my workstation (according established rules of the place I am), my IDE was using the SAAJ 1.4 of IBM JDK implementation to compile my Web Services classes.

(可能)原因:我对问题原因的判断是同一 API 的两个版本实现之间冲突。在设计时,在我的工作站(根据我所在位置的既定规则),我的 IDE 使用 IBM JDK 实现的 SAAJ 1.4 来编译我的 Web 服务类。

IBM\jdk\jre\lib\rt.jar/com\sun\xml\internal\messaging\saaj\soap\SOAPDocumentImpl.class

At runtime, using Tomee(Tomcat) 1.7.3, the same class were being loaded throughout the path:

运行时,使用 Tomee(Tomcat) 1.7.3,在整个路径中加载了相同的类:

$TOMEE_HOME\lib\saaj-impl-1.3.18.jar/com\sun\xml\internal\messaging\saaj\soap\SOAPDocumentImpl.class

And this was causing the verify error at the time the Web Services were executed:

这导致在执行 Web 服务时出现验证错误:

  • java.lang.VerifyError: JVMVRFY012 stack shape inconsistent;
  • (In Portuguese):java.lang.VerifyError: JVMVRFY012 formato de pilha inconsistente;
  • java.lang.VerifyError: JVMVRFY012 堆栈形状不一致;
  • (葡萄牙语):java.lang.VerifyError:JVMVRFY012 格式不一致;

Workaround: Simply, take the saaj-impl-1.3.18.jar out of the Tomee's lib folder (move it). As the Tomee/Tomcat was using the same IBM JDK as my IDE, I found out that the conflict could be because of the saaj-impl-1.3.18.jar localized at the Tomee's lib folder. Moving out of there, make Tomee use the same implementation at runtime that were used at compile time (IBM JDK).

解决方法:只需从 Tomee 的 lib 文件夹中取出 saaj-impl-1.3.18.jar(移动它)。由于 Tomee/Tomcat 使用与我的 IDE 相同的 IBM JDK,我发现冲突可能是因为在 Tomee 的 lib 文件夹中本地化了 saaj-impl-1.3.18.jar。离开那里,让 Tomee 在运行时使用与编译时 (IBM JDK) 相同的实现。

Pay attention that I had this problem at my development workstation, is not a developlment/production(host) environment. Because of the rules of the workstation profile, this is the workaround that I found out works to me.

请注意,我在我的开发工作站上遇到了这个问题,而不是开发/生产(主机)环境。由于工作站配置文件的规则,这是我发现对我有用的解决方法。

回答by Pavan Rao

Well finally i figured it out..

好吧,我终于想通了..

Analysis : The issue occurred because of "jaxb" dependency version. In some of my dependency projects "jaxb" dependency was not included in ivy.xml... This allowed the compiler to take the jaxb present in JDK as dependency. However in other dependency projects, "jaxb" dependency was explicitly defined in ivy with some version ... Because of this, Dependency projects were compiled with different verion of jaxb which would eventually through "VerifyError" wrt to jaxb.

分析:问题是因为“jaxb”依赖版本。在我的一些依赖项目中,ivy.xml 中不包含“jaxb”依赖项……这允许编译器将 JDK 中存在的 jaxb 作为依赖项。然而,在其他依赖项目中,“jaxb”依赖在某些版本的 ivy 中被明确定义......因此,依赖项目是用不同版本的 jaxb 编译的,最终会通过“VerifyError”写入 jaxb。

Solution : Issue is resolved by adding "jaxb" version in ivy for dependency projects which didnt explicitly have jaxb version as well as in main project as Maven dependency.

解决方案:通过在 ivy 中为没有明确具有 jaxb 版本的依赖项目以及在主项目中作为 Maven 依赖项添加“jaxb”版本来解决问题。