3 Replies Latest reply on Oct 5, 2011 1:43 PM by alesj

    jboss-classloading.xml ignored in a war?

    benze

      Hi,


      I'm running JBoss AS6.1 and have a war application that I am trying to deploy.  In my war, I have the slf4j libraries included.  When I start the war, I get the following error messages:

       

      {code}

      17:16:01,288 ERROR [STDERR] SLF4J: Class path contains multiple SLF4J bindings.

      17:16:01,290 ERROR [STDERR] SLF4J: Found binding in [vfs:/home/eric/.eclipse/workspace3/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_6.1_Runtime_Server_-_ALL/deploy/webapp.war/WEB-INF/lib/slf4j-log4j12-1.6.1.jar/org/slf4j/impl/StaticLoggerBinder.class]

      17:16:01,294 ERROR [STDERR] SLF4J: Found binding in [vfs:/opt/jboss/jboss-6.1.0.Final/common/lib/slf4j-jboss-logmanager.jar/org/slf4j/impl/StaticLoggerBinder.class]

      {code}

       

      I tried adding a jboss-classloading.xml file in my WEB-INF/ folder, but it has made no difference.  That error still remains:

       

      WEB-INF/jboss-classloading.xml

       

      {code:xml}

      <?xml version="1.0" encoding="UTF-8"?>

       

       

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

                                   name="myApp.war"

                    domain="myApp.war"

                    import-all="false"

                    export-all="NON_EMPTY"

                    parent-domain="DefaultDomain"

                    parent-first="false">

      </classloading>

       

      {code}

       

       

      And yet, I still get that error message.  Which would imply to me that the classloader is still finding JBoss' SLF4J libs instead of ignoring them completely.


      Am I don't something wrong?  Is the classloading file being ignored in a war?  Do I have something improperly strcutred in the file?


      Thanks,


      Eric

        • 1. Re: jboss-classloading.xml ignored in a war?
          alesj

          No, jboss-classloading.xml should be still picked up in a .war.

          The problem must be somewhere else.

          e.g. could be JBoss Logging -- since we override LogManager afaik

          • 2. Re: jboss-classloading.xml ignored in a war?
            benze

            Ales Justin wrote:

             

            The problem must be somewhere else.

            e.g. could be JBoss Logging -- since we override LogManager afaik

             

            Am not sure what you mean.  How do you override LogManager?  And even if the LogManager is overridden, then shouldn't the jboss-classloading.xml file be indicating to the ClassLoader to use the one from the war and nothing from outside the war?


            Thanks,


            Eric

            • 3. Re: jboss-classloading.xml ignored in a war?
              alesj

              Am not sure what you mean.  How do you override LogManager?  And even if the LogManager is overridden, then shouldn't the jboss-classloading.xml file be indicating to the ClassLoader to use the one from the war and nothing from outside the war?

              At boot time we override the JDK's LogManager with our own.

              But I'm just guessing, as I'm pretty sure the classloading is setup as you define it -- with deployers picking up jboss-classloading.xml.

              Hence the issue must be somewhere else.