1 Reply Latest reply on May 22, 2012 3:33 AM by Marcin L

    jboss 6 class loading

    Marcin L Newbie

      Hi,

      I've got a problem with loading proper log4j implementation.

      The problem is simmilar to

      https://community.jboss.org/message/725292

      and under jboss 7.1 the solution with using jboss-deployment-structure.xml file works for me.

       

      Here is the jboss-deployment-structure.xml (it is located in ear)

       

      <jboss-deployment-structure>

          <sub-deployment name="myresourceadapter.rar">

              <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->

              <exclusions>

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

              </exclusions>

          </sub-deployment>

      </jboss-deployment-structure>

       

      Unfortunatelly I've to allow my resource adapter to work with JBOSS 6.

      In which files I should defines exclussion to not use org.jboss.logmanager.log4j.BridgeLogger as default implemenataion and to use my log4j.located in my resource adapter.

       

      Ear structure:

      myear:

         | --- jar1

         | --- jar2

         | --- myresourceadapter.rar

               | --- log4j (included in rar)

        • 1. Re: jboss 6 class loading
          Marcin L Newbie

          I've found the solution.

          To resolve class loading problem it is neccessary to create in my ear the jboss-classloading.xml file

           

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

              domain="my.ear"

              export-all="NON_EMPTY"

              import-all="true"

              parent-first="false"

              >

             <parent-policy>

                <before-filter>

                   <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.classloader.plugins.filter.NegatingClassFilter">

                      <constructor>

                         <parameter>

                            <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.classloader.spi.filter.RecursivePackageClassFilter">

                               <constructor>

                                  <parameter>org.apache.log4j</parameter>

                               </constructor>

                            </javabean>

                         </parameter>

                      </constructor>

                   </javabean>

                </before-filter>

             </parent-policy>

             

          </classloading>

           

          and in my rar

           

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

              domain="my.rar"

              parent-domain="my.ear"

              export-all="NON_EMPTY"

              import-all="true"

              >

             </classloading>