WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Why does our application fail to start with java.lang.LinkageError: loading constraint violation when overriding method

    Posted Mon September 23, 2024 05:02 PM

    java.lang.LinkageError: loading constraint violation when overriding method "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation.getName()Ljavax/xml/namespace/QName;".Problem:
    We deployed a new application in WebSphere Application Server v8.5.5.25 and restarted the server. During the jvm restart, the application fails to start and
    receives classloading errors. We did not make any application or config changes but we do have appdynamics javaagent.jar in the jvm's classpath.SystemOut     O [ERROR] The xxx.mar module, which is not valid, caused loading constraint violation when overriding method "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation.getName()Ljavax/xml/namespace/QName;" during creation of class "org/apache/axis2/description/AxisOperation": loader "com/ibm/ws/classloader/CompoundClassLoader@3f02e529" of class "org/apache/axis2/description/AxisOperation" and loader "sun/misc/Launcher$ExtClassLoader@daf5eb6f" of class "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation" have different types for the method signature
    java.lang.LinkageError: loading constraint violation when overriding method "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation.getName()Ljavax/xml/namespace/QName;" during creation of class "org/apache/axis2/description/AxisOperation": loader "com/ibm/ws/classloader/CompoundClassLoader@3f02e529" of class "org/apache/axis2/description/AxisOperation" and loader "sun/misc/Launcher$ExtClassLoader@daf5eb6f" of class "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation" have different types for the method signature
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClassInternal(ClassLoader.java:397)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:358)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
    at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:877)
    at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:785)
    at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:626)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:876)
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClassInternal(ClassLoader.java:397)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:358)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
    at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:877)
    at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:785)
    at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:626)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:876)
    at org.apache.axis2.deployment.repository.util.ArchiveReader.readModuleArchive(ArchiveReader.java:514)
    at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:71)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
    at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
    at org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:237)
    at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:68)
    at org.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:63)
    at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:147)
    at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:229)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:68)
    at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516)
    at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:345)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1369)
    at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:653)
    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:619)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:426)
    at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:904)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1211)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1464)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:653)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:1042)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:795)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2279)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5568)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5694)
    at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2284)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436)
    at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:127)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:985)
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:524)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)

    FFDC Exception:java.lang.LinkageError SourceId:com.ibm.ws.webcontainer.servlet.ServletInstance.init ProbeId:181 Reporter:com.ibm.ws.webcontainer.servlet.ServletWrapperImpl@13a0ef24
    java.lang.LinkageError: loading constraint violation when overriding method "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation.getName()Ljavax/xml/namespace/QName;" during creation of class "org/apache/axis2/description/AxisOperation": loader "com/ibm/ws/classloader/CompoundClassLoader@3f02e529" of class "org/apache/axis2/description/AxisOperation" and loader "sun/misc/Launcher$ExtClassLoader@daf5eb6f" of class "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation" have different types for the method signature
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClassInternal(ClassLoader.java:397)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:358)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
    at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:877)
    at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:785)
    at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:626)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:876)
    at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:148)
    at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:229)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:68)
    at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516)
    at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:345)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1369)
    at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:653)
    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:619)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:426)
    at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:904)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1211)



    ------------------------------
    Sai Vamsi Gude
    ------------------------------


  • 2.  RE: Why does our application fail to start with java.lang.LinkageError: loading constraint violation when overriding method

    Posted Tue September 24, 2024 04:58 AM

    Hi, the LinkageError happens when the Class is found in multiple classloaders.  Make sure the Class is not also located in another area of tWAS, like placed in shared library or JVM java/lib/ext directory.  You could also try cleaning the cache from the Profile (removing the contents of profile_name/wstemp/ profile_name/temp/ profile_name/config/temp/).

    Brian



    ------------------------------
    Brian S Paskin
    Sr. Technology Engineer
    IBM Cloud Engineering
    ------------------------------



  • 3.  RE: Why does our application fail to start with java.lang.LinkageError: loading constraint violation when overriding method
    Best Answer

    Posted Tue September 24, 2024 08:16 AM

    Cause:
    Breaking down the LinkageError detail message:

    java.lang.LinkageError: 
    loading constraint violation when overriding method "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation.getName()Ljavax/xml/namespace/QName;" 
    during creation of class "org/apache/axis2/description/AxisOperation": 


    loader "com/ibm/ws/classloader/CompoundClassLoader@3f02e529" of class "org/apache/axis2/description/AxisOperation" and 

    loader "sun/misc/Launcher$ExtClassLoader@daf5eb6f" of class "com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation" 

    have different types for the method signature.


    The 2 classes do not agree on the method signature for com/singularity/ee/agent/appagent/services/bciengine/templates/IAxisOperation.getName()Ljavax/xml/namespace/QName;

    The 2 classes might have loaded the return type javax/xml/namespace/QName from different places.

    com/ibm/ws/classloader/CompoundClassLoader@3f02e529 is an application classloader that loads classes packaged with the ear/war/shared library.
    and sun/misc/Launcher$ExtClassLoader@daf5eb6f is a java classloader that loads classes under <JAVA_HOME>/jre/lib/ext and directory specified by the system property java.ext.dirs.

    It's possible the class javax/xml/namespace/QName might be present in axis2 jar(packaged with your application) AND also in the AppDynamics javaagent jar placed under <JAVA_HOME>/jre/lib/ext.

    Solution:
    Try disabling/removing appdynamics javaagent. Based on our past experience with other clients reporting similar isue, Appdynamics/javaagent seems to be adding duplicate copies of classes and  causing the java.lang.LinkageError. If you do require the appdynamics javaagent/classes, please contact appdynamics support.



    ------------------------------
    GEETA NADELLA
    ------------------------------