This is great!... but my quest to use slf4j as my logging solution is still not fulfilled. The question now is why when I run 'mvn package' or 'mvn jetty:run' when in the myblock directory does maven insist on placing the commons-logging and log4j jar files into WEB-INF/lib even though I've expressly excluded them?

What WEB-INF/lib directory are you referring to? Is it ./target/rcl/webapp/WEB-INF/lib or is it the WEB-INF/lib directory of the web application Maven module?

If it is the first, the answer is that the wrapper web application (a minimal web application that wraps a block) uses the reloading classloader (commons-jci.jar) which has a dependency on commons-logging.

It is the first.

I don't understand... if the wrapper web application depends on commons-logging and makes arrangements to load the commons-logging jar into the classpath it should clash when I attempt to load the jcl-over-slf4j jar file which is supposed to replace the classes in commons-logging so that messages get forwarded to the slf4j logging framework... but they don't!

If I change the dependencies section of myblock/pom.xml to the following, then when I run mvn jetty:run I get bucketloads of debug messages on my console... which I think means SLF4J is working... or maybe I'm deceiving myself!

 <dependencies>
   <dependency>
     <groupId>org.apache.cocoon</groupId>
     <artifactId>cocoon-core</artifactId>
     <version>2.2.0</version>
     <exclusions>
       <exclusion>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
       </exclusion>
       <exclusion>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
       </exclusion>
     </exclusions>
   </dependency>
   <dependency>
     <groupId>org.apache.cocoon</groupId>
     <artifactId>cocoon-servlet-service-components</artifactId>
     <version>1.0.0</version>
   </dependency>
   <dependency>
     <groupId>org.apache.cocoon</groupId>
     <artifactId>cocoon-template-impl</artifactId>
     <version>1.1.0</version>
   </dependency>
   <dependency>
     <groupId>org.apache.cocoon</groupId>
     <artifactId>cocoon-flowscript-impl</artifactId>
     <version>1.0.0</version>
   </dependency>
   <dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>servlet-api</artifactId>
     <version>2.4</version>
     <scope>provided</scope>
   </dependency>
<!-- Logging related dependencies -->
   <dependency>
     <groupId>org.slf4j</groupId>
     <artifactId>jcl-over-slf4j</artifactId>
     <version>1.5.2</version>
   </dependency>
   <dependency>
     <groupId>org.slf4j</groupId>
     <artifactId>log4j-over-slf4j</artifactId>
     <version>1.5.2</version>
   </dependency>
   <dependency>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-api</artifactId>
     <version>1.5.2</version>
   </dependency>
   <dependency>
     <groupId>ch.qos.logback</groupId>
     <artifactId>logback-classic</artifactId>
     <version>0.9.9</version>
   </dependency>
 </dependencies>

Regards,
David Legg


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to