2 Replies Latest reply on Nov 10, 2011 3:56 PM by Michael Whitman

    JBoss 5.1 AS - java.lang.NoClassDefFoundError: org/jdom/Parent

    Michael Whitman Newbie

      I am deploying a war on JBoss 5.1 AS.  This war has run fine on JBoss 4 and on Tomcat 5.5.

       

      error is

       

      org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent

       

      I realize from googling that it could be classloader issue.  The jdom.jar is in WEB-INF/lib. The only other apps running in this instance are apps that come with package.

       

      my jboss-web.xml

       

      <?xml version="1.0"?>

      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">

      <jboss-web>

      <class-loading java2ClassLoadingCompliance="false">

      <loader-repository>

      LitigatorDataLoader:loader=LitigatorDataLoader.war

      <loader-repository-config>java2ParentDelegation=false</loader-repository-config>

      </loader-repository>

      </class-loading>

      </jboss-web>

       

      my jboss-classloading.xml

       

      <classloading xmlns="urn:jboss:classloading:1.0"  

          name="LitigatorDataLoader.war"  

          domain="LitigatorDataLoader_domain"> 

          parent-domain="Ignored" 

          export-all="NON_EMPTY"  

          import-all="true">  

      </classloading>

       

      Any ideas as to what is wrong?

      Thanks, Mike

        • 1. Re: JBoss 5.1 AS - java.lang.NoClassDefFoundError: org/jdom/Parent
          Michael Whitman Newbie

          This war ran under Jboss 4 fine. I understand JBoss 5 has a new classloader but the classloader documentation does not seem to be very good.  I want a jar deployed in my war to supersede any other jars that are part of Jboss or other apps.

           

          Tried this but I am getting the same org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent error:

           

          <classloading xmlns="urn:jboss:classloading:1.0"  

              name="LitigatorDataLoader.war"  

              domain="LitigatorDataLoader.war"> 

              parent-domain="Ignored" 

              export-all="NON_EMPTY"  

              import-all="true"

              parent-first="false"

              >  

          </classloading>

           

          Stacktrace I am getting:

           

          15:10:00,214 ERROR [nyljQueueProcecess] org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent

          15:10:00,214 ERROR [fwLawDecQueueProcecess] org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent

          15:10:00,214 ERROR [fwImgQueueProcecess] org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent

          15:10:00,215 ERROR [STDERR] org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent

          15:10:00,215 ERROR [STDERR]     at org.jdom.xpath.XPath.newInstance(XPath.java:139)

          15:10:00,215 ERROR [STDERR]     at com.incisive.queue.TextFileQueueService.addToQueue(TextFileQueueService.java:52)

          15:10:00,215 ERROR [STDERR]     at com.incisive.queue.GenericLoaderService.loadQueueFromService(GenericLoaderService.java:479)

          15:10:00,215 ERROR [STDERR]     at com.incisive.queue.GenericLoaderService.loadQueueFromServiceCurrentTimeDelta(GenericLoaderService.java:145)

          15:10:00,215 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          15:10:00,215 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          15:10:00,216 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          15:10:00,216 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:592)

          15:10:00,216 ERROR [STDERR]     at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)

          15:10:00,216 ERROR [STDERR]     at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)

          15:10:00,216 ERROR [STDERR]     at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)

          15:10:00,216 ERROR [STDERR]     at org.quartz.core.JobRunShell.run(JobRunShell.java:203)

          15:10:00,216 ERROR [STDERR]     at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

          15:10:00,216 ERROR [STDERR] Caused by: java.lang.NoClassDefFoundError: org/jdom/Parent

          15:10:00,216 ERROR [STDERR]     at org.jaxen.jdom.JDOMXPath.<init>(JDOMXPath.java:91)

          15:10:00,216 ERROR [STDERR]     at org.jdom.xpath.JaxenXPath.setXPath(JaxenXPath.java:281)

          15:10:00,216 ERROR [STDERR]     at org.jdom.xpath.JaxenXPath.<init>(JaxenXPath.java:99)

          15:10:00,216 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          15:10:00,216 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

          15:10:00,216 ERROR [STDERR]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

          15:10:00,217 ERROR [STDERR]     at java.lang.reflect.Constructor.newInstance(Constructor.java:501)

          15:10:00,217 ERROR [STDERR]     at org.jdom.xpath.XPath.newInstance(XPath.java:129)

          15:10:00,217 ERROR [STDERR]     ... 12 more

          • 2. Re: JBoss 5.1 AS - java.lang.NoClassDefFoundError: org/jdom/Parent
            Michael Whitman Newbie

            This fixed it in jboss-classloading.xml

             

            <classloading xmlns="urn:jboss:classloading:1.0"

                              parent-first="false"

                              domain="DefaultDomain"

                              top-level-classloader="true"

                              parent-domain="Ignored"

                              export-all="NON_EMPTY"

                              import-all="true">

            </classloading>

             

            thanks to

            http://thoughts.inphina.com/2010/09/02/classloading-isolation-issues-with-jboss-5-1/