3 Replies Latest reply on Apr 16, 2014 11:25 AM by James Perkins

    JBoss As2 and log4j

    Tojo Jose Newbie

      I have an EAR application , that has two ebj jar's and a war file . I am migrating this application from WebSphere to Jboss Eap6.1 . For logging the application extends from org.apache.log4j.Logger  , but getting a ClassCastException when trying to cast to log4j logger , i think the reason is Jboss by default not using log4j , could you please point me , how  to configure log4j in Jboss.

        • 1. Re: JBoss As2 and log4j
          Tomaz Cerar Master

          show us content of your lib folder(s)

           

          so ear/lib and your war/lib

          • 2. Re: JBoss As2 and log4j
            Tojo Jose Newbie

            Hi Tomaz,

                          I have not packaged the jar's under the EAR lib , instead of that created a "module" for the app jar files , and used that in  ear  meta-inf/jboss-deployment-structure.xml

            and the custome module refers to

            <dependencies>
               <module name="javaee.api" export="true"/>
               <module name="org.apache.log4j" export="true"/>

                </dependencies>

               ----   My application jar's

             

             

            and org.apache.log4j  depends on

                     C:\jboss-eap-6.2\modules\system\layers\base\org\jboss\log4j\logmanager\main\log4j-jboss-logmanager-1.0.2.Final-redhat-1.jar

             

            and also , log4j.xml  properties in the class path.

            • 3. Re: JBoss As2 and log4j
              James Perkins Master

              Do you include your own copy of log4j or have a copy of log4j in your deployment?

               

              The org.apache.log4j module is an alias for org.jboss.log4j.logmanager. This means that you can use either module name, but you'll end up getting org.jboss.log4j.logmanager as the dependency.

               

              --

              James R. Perkins