Hi Ceki,

This is a hard one to replicate - the environment is complex. My current environment has four IDEA project modules, each with log4j dependencies. One of these modules lists ApacheDS as a dependency. The jar for ApacheDS is holding an unpacked slf4j and log4j distro, (see attached screenshot).

When I run a main method in module1 (which doesn't use ApacheDS) all log statements in modules 1, 2 and 3 work quite well. When it finally reaches a logging statement in module4, which *does* use ApacheDS, I see a NoSuchMethodError:

java.lang.NoSuchMethodError: org.apache.log4j.Logger.info(Ljava/lang/String;)V

The stacktrace is simply related to the chain of execution in the current thread (here a TCP Connection, because Im making a HTTP Request). It doesn't look helpful in this regard but I can send it to you if you would like to see it. It simply seems that the JVM is trying to execute a method which doesn't exist.

If I run IDEA with module4 alone, with the log4j dependency and an ApacheDS dependency (which includes nlog4j, the same screenshot applies), logging works.

Your basic provision that code compiled against log4j will work with nlog4j should satisfy our needs, and I agree that it doesn't need to be bi-directional.

Let me know if you need further information. Good luck!

Cheers,
Nick


Ceki Gülcü wrote:

Hello Nick,

Could you send me the a stack trace of the NoSuchMethodError?

As of NLOG4J 1.2.16, code compiled against log4j.jar will run fine with nlog4j.jar. However, the inverse is not true. Code compiled with NLOG4J will only run with NLOG4J. This means that your code, when compiled with NLOG4J, will depend on NLOG4J, which in my humble opinion is a rather reasonable requirement, especially if you consider that NLOG4J has SLF4J support which log4j does not have.

Considering the direction of compatibility, perhaps you are trying to access methods only available in nlog4j when only log4j.jar is available in the class path?

Being somewhat familiar with IDEA, I'd be happy to try reproduce the problem. Do you have a tiny project/test case to make it easy for me?

Cheers,

At 03:31 AM 9/13/2005, Nick Faiz wrote:

Hey Alex (and others),

I was originally sending this to Alex, as a follow up to an interrupted IM chat, but thought it relevant to send to the dev list. It relates to upgrading nlog4j.

Check out maven.org/ibiblio under org.slf4j - you will find nlog4j.1.2.17 .

http://www.ibiblio.org/maven/org.slf4j/jars/

We need to find a solution for this NoSuchMethodError - I keep seeing it in IDEA but havent had time to test with ApacheDS in any other embedded capacity. It's a blocker.

Whenever I hit an nlog4j log statement in IDEA, when I have several modules open, and when my own source code uses log4j but one of the modules references ApacheDS, I see a NoSuchMethodError.

Nick

--
ATLASSIAN - http://www.atlassian.com/

Confluence - the enterprise wiki - tried it yet?
http://www.atlassian.com/confluence/
--




--
ATLASSIAN - http://www.atlassian.com/

Confluence - the enterprise wiki - tried it yet?
http://www.atlassian.com/confluence/
--

GIF image

Reply via email to