5 Replies Latest reply on Mar 1, 2012 2:23 PM by Tanya Ruttenberg

    moving from 7.0.1 to 7.1final , getting NoClassDefFoundError

    robert walker Newbie

      hi all, i am trying to move to the new 7.1.0 from the 7.0.1 release. I have no errors in 7.0.1

       

      I only have 1 deployed webapp, and apparently something is not being found.

       

      I do indeed have a 7.1.0.Final/modules/org/apache/log4j/main/log4j-1.2.16.jar so unsure why is is stating   NoClassDefFoundError: org/apache/log4j/Priority

       

      maybe it is not really a NoClassDefFoundError but more of a conflict error causing not found, but not sure where to begin

       

       

      thanks all

       

      .... and BTW, great app server!   we are using  jee 6 type structure/technologies with stateless session beans and richfaces 4, great stuff!!!!

       

       

       

       

       

       

      13:26:02,751 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-1) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.logging.Log4jLogger
              at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]
              at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0.10]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0.10]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0.10]
      Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Priority
              at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0.10]
              at java.lang.Class.privateGetDeclaredFields(Class.java:2318) [rt.jar:1.6.0.10]
              at java.lang.Class.getDeclaredFields(Class.java:1747) [rt.jar:1.6.0.10]
              at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184) [guava-r08.jar:]
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153) [guava-r08.jar:]
              at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69) [guava-r08.jar:]
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)
              at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              ... 11 more
      Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Priority from [Module "org.jboss.logging:main" from local module loader @b01d43 (roots: /opt/app/jboss-as-7.1.0.Final/modules)]
              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
              ... 29 more

      13:26:02,913 INFO  [org.jboss.seam.solder.core.CoreExtension] (MSC service thread 1-1) Preventing class org.jboss.seam.solder.resourceLoader.ResourceProvider from being installed as bean due to @Veto annotat
      ion
      13:26:02,991 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-1) WELD-000119 Not generating any bean definitions from org.jboss.logging.Slf4jLogger because of underlying class loading error
      13:26:02,993 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-1) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.logging.Slf4jLogger
              at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

      at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]
              at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0.10]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0.10]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0.10]
      Caused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
              at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0.10]
              at java.lang.Class.privateGetDeclaredFields(Class.java:2318) [rt.jar:1.6.0.10]
              at java.lang.Class.getDeclaredFields(Class.java:1747) [rt.jar:1.6.0.10]
              at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184) [guava-r08.jar:]
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153) [guava-r08.jar:]
              at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69) [guava-r08.jar:]
              at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)
              at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              ... 11 more
      Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger from [Module "org.jboss.logging:main" from local module loader @b01d43 (roots: /opt/app/jboss-as-7.1.0.Final/modules)]
              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
              ... 29 more

      13:26:03,028 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-1) WELD-000119 Not generating any bean definitions from org.jboss.logging.Slf4jLocationAwareLogger because of underlying class loading e
      rror
      13:26:03,030 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-1) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.logging.Slf4jLocationAwareLogger
              at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]
              at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]

        • 1. Re: moving from 7.0.1 to 7.1final , getting NoClassDefFoundError
          Naeem Ally Newbie

          Hi

           

          If you look closer at your stacktrace it is complaining about Caused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;

          Try adding slf4j as a dependency, i think you may need commons logging as well.

          • 2. Re: moving from 7.0.1 to 7.1final , getting NoClassDefFoundError
            robert walker Newbie

            okay, i guess 7.0.x version of jboss's jar and dependencies related slf4j  has changed

            in the new 7.1.x.     

             

            the reason i believe something changed is because I am trying to deploy the same webapp (with same jars included)

            on the two differenet version of jboss and the newer jboss throws exceptions

             

            I am going to try to add an implementation of logging to maven dependency and redeploy

             

             

            stay tuned

            • 3. Re: moving from 7.0.1 to 7.1final , getting NoClassDefFoundError
              Tanya Ruttenberg Expert

              I had this problem with a different module. Notice that org.jboss.weld is throwing the error.  You have to go down to the module whose library is throwing the error and add org.slf4j and org.apache.log4j to the dependencies for *the module*.  It will do no good to add it to your app -- it least it did me no good.

               

              In my case, it was org.jboss.logging that was throwing the error so I added the dependencies to the module for org.jboss.logging like this

               

              <module xmlns="urn:jboss:module:1.1" name="org.jboss.logging">
                  <resources>
                      <resource-root path="jboss-logging-3.1.0.GA.jar"/>
                      <!-- Insert resources here -->
                  </resources>

                  <dependencies>
                      <module name="org.jboss.logmanager"/>
                      <module name="org.slf4j" />
                      <module name="org.apache.log4j" />
                  </dependencies>
              </module>

               

              TDR

              • 4. Re: moving from 7.0.1 to 7.1final , getting NoClassDefFoundError
                robert walker Newbie

                TDR, ur awesome, thank you,

                 

                i changed my jboss 7.1 module for logging

                 

                C:\jboss-as-7.1.0\modules\org\jboss\logging\main\module.xml

                 

                from the stock

                 

                <module xmlns="urn:jboss:module:1.1" name="org.jboss.logging">
                    <resources>
                        <resource-root path="jboss-logging-3.1.0.GA.jar"/>
                        <!-- Insert resources here -->
                    </resources>

                    <dependencies>
                        <module name="org.jboss.logmanager"/>
                    </dependencies>
                </module>

                 

                to

                 

                <module xmlns="urn:jboss:module:1.1" name="org.jboss.logging">
                    <resources>
                        <resource-root path="jboss-logging-3.1.0.GA.jar"/>
                        <!-- Insert resources here -->
                    </resources>

                    <dependencies>
                        <module name="org.jboss.logmanager"/>
                        <module name="org.slf4j" />
                        <module name="org.apache.log4j" />
                    </dependencies>
                </module>

                 

                and all exceptions went away, no application changes or anything else.

                 

                is this an error or something the jboss developers should be aware of?

                • 5. Re: moving from 7.0.1 to 7.1final , getting NoClassDefFoundError
                  Tanya Ruttenberg Expert

                  Apparently this should be considered a workaround.  Read this https://community.jboss.org/message/720944

                  I opened a JIRA about it.