"/>

知方号

知方号

IBM Java for Linux HowTo: Resolving "java.lang.VerifyError: JVMVRFY012 stack shape inconsistent"

Answer

This article discusses the Java error message "java.lang.VerifyError: JVMVRFY012 stack shape inconsistent" and how to resolve it.OverviewDetails

What is a Verify Error?

The JVM contains a verifier which is responsible for verifying all bytecode before being executed. Often, bytecode with internal inconsistencies or security problems will trigger a verify error.For example,java.lang.VerifyError: JVMVRFY012 stack shape inconsistent;class=com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl,method=createDocumentFragment()Lorg/w3c/dom/DocumentFragment;, pc=5

What causes a Verify Error?

As a security feature, the JVM verifies all bytecodes in order to avoid injection of malicious code via bytecode modification. The error can also occur when:-code is compiled against a different library than the one being used at runtime-a class tries to extend a class declared as final-a method tries to override a super method that is declared as final-a wrong argument is passed to a method

Disabling the verification engine

The bytecode verifiier is on by default. To enable maximum verification, add the following Java command line option:-Xverify:allTo disable the verifier, add the following Java command line option:-Xverify:noneTo enable remote strict class-loading checks on remotely loaded class use, add the following Java command line option:-Xverify:remoteNote: For security reasons, never disable bytecode verification on a production system

Resolving a Verify Error in your code

It most cases, verify errors are the result incompatible 3rd party libraries. The diagnostic message will identify any inconsistent class and method. For example:java.lang.VerifyError: JVMVRFY012 stack shape inconsistent;class=com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl,method=createDocumentFragment()Lorg/w3c/dom/DocumentFragment;, pc=5 To locate the jar file a class is being loaded from, add -verbose:dynload and -verbose:class to your Java command lineMake sure you compile all classes with the same Java version. Please reference only the public class of the Java API. Your code should not depend on internal classes which are subject to change.

Section 5

Section 6

Section 7

Section 8

Section 9

Section 10

Section 11

Section 12

Section 13

Section 14

Section 15

Section 16

Section 17

Section 18

Section 19

Section 20

Contact IBM Support

If, after reading and following the above instructions, further assistance is required, please complete the following steps:1. Confirm that you have review and completed all of the above steps.2. Contact IBM and open a new IBM service request (i.e., a new IBM PMR).3. Collect and upload data as per the data collection procedures noted in the above sections or package and upload the current data and details by following the instructions on this web page:IBM Java for AIX MustGather: How to upload diagnostic data and testcases to IBM

Document Type:Technical DocumentContent Type:GeneralHardware:all PowerOperating System:all Linux VersionsIBM Java:all Java VersionsAuthor(s):John CarverReviewer(s):Vidya MakineediClick here to submit feedback for this document.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lizi9903@foxmail.com举报,一经查实,本站将立刻删除。