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 Ralf Schneider <ra...@tapfere-schneiderleins.de> on 2004/01/04 21:18:11 UTC

NoClassDefFoundError: org/apache/log4j/Logger

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I get the above error message when starting Tomcat 5.0.7 (which comes with 
JWSDP 1.3 from Sun) inside Eclipse. I put log4j-1.2.8.jar into the 
WEB-INF/lib directory of my web application and added the JAR-file to the 
"Java Build Path" property of my Java project. When I compile the project 
everything works fine. No error messages. But when I start Tomcat I get the 
above error message. 

A friend told me that the described procedure worked for him with a 
"standalone" Tomcat 4.1.27. Are there any problems with the Tomcat version 
that comes with JWSDP 1.3?

Any ideas what might be the problem?

Best regards,
Ralf.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/+HUD7YyyfykA0YkRAuq7AJ9+LBnyg8r6Y34Epp8ldhHprnCuWQCfbn+b
6aNIAkKSSZY66nrAoZJCBio=
=2n5J
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: NoClassDefFoundError: org/apache/log4j/Logger

Posted by Jacob Kjome <ho...@visi.com>.
I smell commons-logging somehow finding log4j in a different classloader 
(WEB-INF/lib) and trying to use it in another classloader.  I won't 
speculate as to exactly how it accomplishes this feat, but it is almost 
definitely commons-logging's fault.  Anyway, try adding log4j.jar to 
CATALINA_HOME/common/lib.  You might also want to add a log4j.xml file in 
common/classes which simply supplies a console appender.  Then to make sure 
app logging is separated, either put log4j.jar in each app's WEB-INF/lib 
and/or use a custom repository selector.

Jake

At 09:18 PM 1/4/2004 +0100, you wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>I get the above error message when starting Tomcat 5.0.7 (which comes with
>JWSDP 1.3 from Sun) inside Eclipse. I put log4j-1.2.8.jar into the
>WEB-INF/lib directory of my web application and added the JAR-file to the
>"Java Build Path" property of my Java project. When I compile the project
>everything works fine. No error messages. But when I start Tomcat I get the
>above error message.
>
>A friend told me that the described procedure worked for him with a
>"standalone" Tomcat 4.1.27. Are there any problems with the Tomcat version
>that comes with JWSDP 1.3?
>
>Any ideas what might be the problem?
>
>Best regards,
>Ralf.
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.1 (GNU/Linux)
>
>iD8DBQE/+HUD7YyyfykA0YkRAuq7AJ9+LBnyg8r6Y34Epp8ldhHprnCuWQCfbn+b
>6aNIAkKSSZY66nrAoZJCBio=
>=2n5J
>-----END PGP SIGNATURE-----
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org