0 Replies Latest reply on Jan 7, 2004 12:17 PM by sys user

    ClassLoader Problem with multiple log4j versions in classpat

    sys user Master

      Hi,
      When I deploy an ear file, I see an error that I suspect is ocurring due to conflicts between the 2 different versions of og4j.jar files loaded from jboss/lib and my application's ear file. How do I go about resolving this? Any pointers to documentation about class loaders in jboss 3.2.2 would be appreciated.

      My ear file that has the following structure:
      application.xml
      Manifest.mf
      jboss-app.xml
      ejbs.jar
      web-app.war
      lib/log4j.jar (v1.1.3)
      lib/xerces.jar (1.2.2)
      lib/xalan.jar (1.2.2)

      My jboss-app.xml file is as follows:
      <jboss-app>
      <loader-repository loaderRepositoryClass="org.jboss.mx.loading.HeirarchicalLoaderRepository3">
      ugsplm.com:loader=my-app.ear
      <loader-repository-config configParserClass="org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser">
      java2ParentDelegaton=false
      </loader-repository-config>
      </loader-repository>
      </jboss-app>

      The error that I see is in loading an EJB:
      2004-01-07 11:02:26,898 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" object.
      2004-01-07 11:02:26,898 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:jndiName=MyEJBName,service=EJB
      java.lang.ExceptionInInitializerError:
      java.lang.ClassCastException: org.jboss.logging.appender.FileAppender
      at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:574)
      at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:555)
      at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:462)
      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:388)
      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:414)
      at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:345)
      at org.apache.log4j.Category.(Category.java:160)
      at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:582)


      Thanks
      Sriram