3 Replies Latest reply on Jun 8, 2011 12:01 AM by Jason Shepherd

    JBoss 5 WAR deployer - why does the class loader filter org.apache.commons.logging?

    Jason Royals Newbie

      Question for the guru's.


      My application has it's own log configuration - the JBoss server logs and my application logs are managed separately. My application uses SLF4J and Logback and it works quite well. So that I can capture my applications Spring logs (and other libraries using Commons Logging), I include jcl-over.slf4j.jar. This jar simply implements the Commons Logging API and routes the messages to SLF4J, and on other app servers this works beautifully.


      On JBoss, this doesn't work. Any messages logging via the commons-logging API are swallowed up and not logged out.


      The reason is that the ./deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml defines two packages that should never be loaded by the webapp class loader - javax.servlet (no surprises there) and org.apache.commons.logging. That surprised me because I can think of no good reason for JBoss to do that. When I remove the filter for commons-logging, everything works and we see our logs.


      Before I go ahead and remove this class loader filter for commons logging, I'd like to understand the resoning in having it there in the first place. Am I likely to break anything by doing this?