You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Faggart, Robin" <rf...@carreker.com> on 2006/05/17 23:23:08 UTC

Log4j NoClassDefFoundError

Hi..

I'm running a stand-alone java app -i.e. no Websphere on two different
AIX boxes,  TST04 and DEV03.  Currently the version of Java 1.4
installed on  TST04 is 1.4.2 and on DEV03 is 1.4.1.  The code calls the
apache logging code (log4j) and  it runs fine on DEV03.  On TST04, I
consistently get the following error when the Logger is instantiated:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Logger

Just as a test, I copied the Java 1.4.1 environment over to TST04 and I
pointed to that environment.  The program worked...which is consistent
with what I see on the DEV03 1.4.1 environment.

At that point I was convinced that it was a log4j problem with 1.4.2,
but I've since then put together a very simple standalone program that
does nothing more than create a logger and write messages to a file.
That program works on both 1.4.2 and 1.4.1.  I've also seen cases (and
I've fixed them all, I think) where I see this same error reported
because file permissions are incorrect.   I fully understand that the
log4j.jar file has to be in the classpath...and it is.  If it wasn't, it
wouldn't work under either environment.  

Because of the second program working, I have to rule out that it's a
"log4j" "java version 1.4.2" compatibility problem...but I'm just
wondering if there's anyone out there that might be able to shed some
light on this...

Thanks
Robin