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 engineThe 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 codeIt 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 5Section 6Section 7Section 8Section 9Section 10Section 11Section 12Section 13Section 14Section 15Section 16Section 17Section 18Section 19Section 20Contact IBM SupportIf, 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.