2 Replies Latest reply on Apr 9, 2003 6:51 AM by paveu

    Problem with application using log4j1.2.8 on JBoss 3.0.6

    paveu

      Hello!

      I wrote a set of monitors for viewing logs. I extended LogFactor5 from log4j 1.2.8 to make things easier.
      I'm using JMS to send logs from applications to JBoss. MBean is runnung on JBoss and is recieving messages through appriopriate topic.
      Problem comes when in this MBean I try to use classes and methods introduced in log4j 1.2.8 JBoss throws NoSuchMethodException. Probably becouse it tries to use classes from its own log4j which unfortunatelly is 1.2.2
      How to make my MBean or JBoss to use in my application (running on JBoss) log4j1.2.8 clasesses included in JAR instead of default JBosses log4j 1.2.?
      Thanks for patience in reading
      and for answer if it comes ;-)
      Pawel

        • 1. Re: Problem with application using log4j1.2.8 on JBoss 3.0.6
          paveu

          OK, here's the deal:

          The problem lays in class loading.
          When I import org.apache.log4j.spi.LoggingEvent in my standalone JMS publisher, it is taken from log4j-1.2.8.jar on classpath.
          But! when I import org.apache.log4j.spi.LoggingEvent in MBean (which is JMS subscriber) running on JBoss it is loaded from JBOSS_HOME/lib/log4j-boot.jar even thou I included log4j-1.2.8.jar in my MBean.jar, and added it to Class-Path: in MANIFEST.MF.

          How to make JBoss to load LoggingEvent from jar included in Class-Path: of my jar instead of loading it from JBOSS_HOME/lib/log4j-boot.jar???

          Thanks for answer in advance
          Pawel

          • 2. Re: Problem with application using log4j1.2.8 on JBoss 3.0.6
            paveu

            Alright!

            As for now, renaming log4j-1.2.8.jar to log4j-boot.jar and putting it into JBOSS_HOME/lib/ helped. But I'm not yet sure if not harmed too...

            Still hoping for new ideas
            Greetings
            Pawel