Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 5375 invoked from network); 24 Feb 2006 16:45:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Feb 2006 16:45:48 -0000 Received: (qmail 79315 invoked by uid 500); 24 Feb 2006 16:45:47 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 79237 invoked by uid 500); 24 Feb 2006 16:45:46 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 79226 invoked by uid 99); 24 Feb 2006 16:45:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2006 08:45:46 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.74.184.209] (HELO mail.qos.ch) (212.74.184.209) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2006 08:45:45 -0800 Received: from kal.qos.ch (kal [192.168.1.3]) by mail.qos.ch (Postfix) with ESMTP id E038511C751; Fri, 24 Feb 2006 17:45:22 +0100 (CET) Message-Id: <6.0.0.22.0.20060224165655.03beda30@mail.qos.ch> X-Sender: blocked@mail.qos.ch (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Fri, 24 Feb 2006 17:44:42 +0100 To: "Apache Directory Developers List" , "'Apache Directory Developers List'" From: Ceki =?iso-8859-1?Q?G=FClc=FC?= Subject: RE: [ApacheDS] JBoss compatibility? In-Reply-To: References: <6.0.0.22.0.20060224102914.03b83280@mail.qos.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N At 04:49 PM 2/24/2006, Endi S. Dewata wrote: >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 =3D 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 =3D 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, I think your description of the problem is quite valuable. Compilation against NLOG4J is sticky, in the sense that you cannot later=20 revert back to log4j. However, I think that this is not the problem you are= =20 facing. As far as I know ApacheDS does not invoke log4j directly, it=20 invokes the SLF4J API instead. From what you describe, the mere presence of= =20 log4j in JBoss' class loader path, messes up SLF4J's NLOG4J binding. As an immediate fix, you can just replace JBoss' copy of log4j with NLOG4J.= =20 This should fix the problem as far as you are concerned. Another perhaps=20 better solution, is to replace nlog4j.jar which ships with ApacheDS with=20 slf4j-log4j12.jar without replacing any jar files in JBoss. FYI,=20 slf4j-log4j12.jar ships with the SLF4J distribution. I guess that this should be added to ApacheDS documentation in order to=20 avoid similar inconveniences to other JBoss+ApacheDS users. Maybe that is=20 already the case? >-- >Endi S. Dewata --=20 Ceki G=FClc=FC