What causes NoSuchMethodError classloading issues in JBoss EAP

Solution Verified - Updated -

Issue

  • In our EAR file, we have several JAR files that contain our EJB class, a WAR file, and a bunch of JAR files as supporting libraries (i.e. stuff like commons libraries, xml libraries, etc.).  Everything is at the top level of the EAR file.
  • Trrying to resolve a classloading issue with a third party product we use, We resolved the issue by moving all the libraries we use within the EAR into a directory within the EAR file instead of having all the JARs at the top level of the EAR file (we udpated all the manifest files accordingly).
  • To address the errors in the server.log file, we simply moved jrules-engine.jar, jrules-res-manage-tools.jar, and jrules-res-session.jar files to a sub folder (we named the folder "lib" inside the EAR) and updated all the manifest files accordingly.

    Caused by: java.lang.NoSuchMethodError: ilog.rules.archive.IlrRulesetArchive.getStringEncoder()Lilog/rules/archive/a;
      at ilog.rules.engine.IlrRulesetArchiveParser.if(Unknown Source)
    
  • We are seeing a NoSuchMethodError occasionally when our application is running in JBoss EAP. When we start JBoss if the error occurs it always occurs, but then sometimes when we start JBoss the call works without error and will work until we restart.

    java.lang.NoSuchMethodError: org.exolab.castor.xml.util.XMLFieldDescriptorImpl.setClassDescriptor(Lorg/exolab/castor/xml/XMLClassDescriptor;)V
            com.jboss.examples.castor.TestExample.<init>(TestExample.java:13)
            sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            java.lang.Class.newInstance0(Class.java:355)
            java.lang.Class.newInstance(Class.java:308)
            org.exolab.castor.xml.util.resolvers.ByDescriptorClass.internalResolve(ByDescriptorClass.java:84)
            ...
    
  • We got this error when deploying to some of the nodes in our cluster:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/v3]] (main) action: null
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.context.support.XmlWebApplicationContext]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
  • Is there a way to control which version of the class or jar is loaded first from the war ?
{ERROR}[2015-07-14 20:35:17,384]:(com.ssga.ssgai.pim.generator.client.tools.BatchWebExtractGeneratorWorker:call:166)-- Exception generating instance for web extract config 7668336; publication instance ID = 19651318. Nested exception message: Unexpected Error
java.lang.NoSuchMethodError: javax.wsdl.factory.WSDLFactory.newInstance(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/wsdl/factory/WSDLFactory;
  • Getting following error in server log.
  "{\"WFLYCTL0080: Failed services\" => {\"jboss.deployment.unit.".undertow-deployment\" => \"java.lang.NoSuchMethodError: 'java.lang.ClassLoader com.sun.faces.util.Util.getContextClassLoader2()'
    Caused by: java.lang.NoSuchMethodError: 'java.lang.ClassLoader com.sun.faces.util.Util.getContextClassLoader2()'\"}}"

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
    • 5.x
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content