IBM Support

"java.lang.VerifyError: JVMVRFY013 class loading constraint violated" Error Occurs with WebSphere Application Server using IBM Technology for JVM



This document will describe an issue where a "java.lang.VerifyError: JVMVRFY013 class loading constraint violated" error occurs with WebSphere Application Server using IBM Technology for JVM when accessing a WSDL exposed by Axis2.

Resolving The Problem


When accessing a Web application within WebSphere Application Server using the IBM Technology for JVM and Apache Axis2 framework with an application server/WAR class loader order set to PARENT_LAST, the following error might be encountered:

    • - java.lang.VerifyError: class loading constraint violated (class: org/apache/xerces/dom/CoreDocumentImpl method: getDomConfig()Lorg/w3c/dom/DOMConfiguration;) at pc: 0

      at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify( at java.lang.J9VMInternals.verify( at java.lang.J9VMInternals.verify( at java.lang.J9VMInternals.initialize( at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source) at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at org.apache.log4j.xml.DOMConfigurator$2.parse( at org.apache.log4j.xml.DOMConfigurator.doConfigure( at org.apache.log4j.xml.DOMConfigurator.doConfigure( at org.apache.log4j.helpers.OptionConverter.selectAndConfigure( at org.apache.log4j.LogManager.( at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize( at org.apache.log4j.Logger.getLogger( at at at at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance( at org.apache.axis2.deployment.util.Utils$ at at org.apache.axis2.deployment.util.Utils.loadHandler( at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseList( at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseOrders( at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig( at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration( at org.apache.axis2.deployment.WarBasedAxisConfigurator.( at org.apache.axis2.transport.http.AxisServlet.initConfigContext( at org.apache.axis2.transport.http.AxisServlet.init( at at at at at at at at at at at at at at at at at at at at at at$ at$ at$

    A PARENT_LAST class loader order also known as Classes loaded with local class loader first or Application first is defined as the following:

    "The PARENT_LAST" class loader mode causes the class loader to attempt to load classes from it local class path before delegating the class loading to it parent.  Using this policy, an application class loader can override and provide its own version of a class that exists in the parent class loader."

    Note: The issue does not occur if the parent-delegation model is set to PARENT_FIRST.

    As part of the IBM Technology for JVM new class loading mechanism with a parent-delegation model, class loading loads, verifies, prepares, resolves, and initializes a class from a Java class file.
    oLoading involves obtaining the byte array representing the Java class file.
    oVerification of a Java class file is the process of checking that the class file is structurally well-formed and then inspecting the class file contents to ensure that the code does not attempt to perform operations that are not permitted.
    oPreparation involves the allocation and default initialization of storage space for static class fields. Preparation also creates method tables, which speed up virtual method calls, and object templates, which speed up object creation.
    oInitialization involves the processing of the class's class initialization method, if defined, at which time static class fields are initialized to their user-defined initial values (if specified).
    For more information on class loading with the IBM Technology for JVM, you should refer to the following URL:

    Note: The IBM Classic JVM uses a different class loading policy and model. Because of this, the issue described in this document will not occur with the Classic JVM. The Classic JVM could be used as a work-around; however, it can be used only on a temporary basis because it is no longer available beginning at IBM i 7.1 OS.

    In this case, an error occurs during the verification step of the class loading process. The java.lang.VerifyError is a subclass of a java.lang.LinkageError. A VerifyError is thrown when the "verifier" detects that a class file, though well formed, contains some sort of internal inconsistency or security problem. Subclasses of the LinkageError indicate that a class has some dependency on another class; however, the latter class is incompatible after the compilation of the former class.

    If this verbiage is related to the exception above, the error starts to make more sense. The exception indicates we are loading the same classes (org/apache/xerces/dom/CoreDocumentImpl and org/w3c/dom/DOMConfiguration) with two different class loaders (JDK and Application (WAR) classloaders); however, a referenced class (org/w3c/dom/Notation) is only loaded by one of them (JDK class loader). The org/apache/xerces/dom/CoreDocumentImpl class references the org/w3c/dom/DOMConfiguration class which then references the org/w3c/dom/Notation class. When the application creates its own org/apache/xerces/dom/CoreDocumentImpl and org/w3c/dom/DOMConfiguration instances, it will load the classes from the WAR class loader path (because of the "PARENT_LAST" policy). The class org/w3c/dom/Notation is loaded by the JDK class loader since it does not exist in any of the Jars or classes included in the WAR class loader path. Then, the application would attempt to pass an instance of the JDK org/w3c/dom/Notation class to the WAR instance of org/w3c/dom/DOMConfiguration, which can only accept an instance of the WAR version of the org/w3c/dom/Notation class. This results in the java.lang.VerifyError.


    Ultimately, an issue is seen where the Apache Axis2 product packaged with the WAR file contains a XmlBeans library (xmlbeans-2.3.0.jar) with a set of interfaces in the org.w3c.dom package that may cause issues with class loaders using a PARENT_LAST class loading policy. These interfaces reference other Java classes which are loaded by the JDK class loader and not by the WAR class loader as expected. To avoid the issue, the Apache Axis2 version either needs to be updated to the latest specification, and you must remove the XmlBeans library (xmlbeans-2.3.0.jar) from the Axis2 WAR, or remove the content of the org.w3c.dom package from the XmlBeans library.

    For more information related to the Apache Axis2/Java project and to obtain the latest specification release, you should refer to the following URL:

    [{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"WebSphere Application Server","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.3;7.2;7.1;6.1.1;6.1.0;5.4.5;5.4.0","Edition":"All Editions;WAS v9.0;WAS v8.5.5;WAS v8.0;WAS v7.0","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSC3X7","label":"IBM i 6.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC52E","label":"IBM i 7.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSTS2D","label":"IBM i 7.3"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC5L9","label":"IBM i 7.2"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

    Historical Number


    Document Information

    Modified date:
    18 December 2019