9 Replies Latest reply on Mar 7, 2013 1:29 PM by James Perkins

    ClassNotFoundException: org.apache.commons.logging.LogSource

    flp05 Newbie

      Hi all,

       

      I'm having some problems configuring logging on Jboss AS 7.1.1.Final.

      I already read a few discussions about this but, I still cant' solve my problem.

       

      I tried two solutions:

       

       

      1. My first approach was to disable Jboss logging module:

                I add log4j.jar to the lib folder and in my jboss-deployment-structure.xml, I add:

          

                     ...
                     <deployment>
                           <exclusions>
                                 <module name="org.apache.log4j" />
                           </exclusions> 
                       </deployment>
             
                   <sub-deployment name="SDAWeb.war">
                           <exclusions>
                              <module name="org.apache.log4j" />
                            </exclusions>
                  </sub-deployment>
                     ---
      

       

                    However, I was gettinh this error:

                    

                     14:12:20,293 ERROR [stderr] (MSC service thread 1-3) log4j:WARN No appenders could be found for logger (fr.framework.hibernate.HibernateMappingScanner).
      
                     14:12:20,293 ERROR [stderr] (MSC service thread 1-3) log4j:WARN Please initialize the log4j system properly.
      
                     14:12:20,293 ERROR [stderr] (MSC service thread 1-3) log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
      

       

       

      2. My second approach was to remove log4j and commons-logging from my lib folder, and add this to my jboss-deployment-structure.xml (which shouldn't be needed since they are core dependencies):

       

                     <module name="org.apache.commons.logging" />
                     <module name="org.apache.log4j" />
      

       

                     However, I'm getting this error, when I try to acess a class from commons-logging:

       

                     java.lang.ClassNotFoundException: org.apache.commons.logging.LogSource 
      

       

                     Can this has something to do with the fact that I'm trying to access logging from a Java project ( deployed to the lib folder). Can a .jar from the lib folder still access Jboss modules like logging?

       

       

      Thanks,

      Luís