directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Endi S. Dewata" <end...@safehaus.org>
Subject RE: [ApacheDS] JBoss compatibility?
Date Fri, 24 Feb 2006 15:49:28 GMT
Hi Ceki,

> Which version of NLOG4J and ApacheDS are you using? Versions of NLOG4J 
> prior to 1.2.16 did indeed have a runtime compatibility issue with log4j. 
> However, NLOG4J version 1.2.16 and later should not suffer from the
> problem you describe. Thus, it is important to know the version of
> ApacheDS and NLOG4j that you are using.

I'm checking out the latest ApacheDS (version 1.0 RC1) from the svn trunk,
the apacheds/core/pom.xml says that it's using nlog4j version 1.2.19.

I also downloaded JBoss 4.0.3 SP1 source code, and there is a log4j.jar file
in thirdparty/apache-log4j/lib directory which should be version 1.2.8
according to component-info.xml.

So I tried compiling a small program using Log4j API:

  import org.apache.log4j.*;

  public class Test {
      public static void main(String args[]) {
          Logger log = Logger.getLogger(Test.class);
          log.debug("Test");
      }
  }

I compiled it with nlog4j-1.2.19.jar, then I tried to run it with log4j.jar
from JBoss, then I got this error:

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.log4j.Logger.debug(Ljava/lang/Str
ing;)V

It looks like the nlog4j has a debug(String) but the log4j doesn't.

I also tried the following program using SLF4J API:

  import org.slf4j.*;

  public class Test {
      public static void main(String args[]) {
          Logger log = LoggerFactory.getLogger(Test.class);
          log.debug("Test");
      }
  }

I compiled it with nlog4j-1.2.19.jar, then I tried running it with log4j.jar
and nlog4j-1.2.19.jar in the class path in this order, then I got this
error:

  Exception in thread "main" java.lang.IncompatibleClassChangeError

The error also occurs when executing log.debug(...) statement.

If I reverse the order of the jar files, it will work fine because nlog4j
will be loaded first. However in JBoss this is not possible because JBoss
classes will be loaded first before the SAR files. Any suggestions? Thank
you very much.


--
Endi S. Dewata


Mime
View raw message