This generally means that a couple different instances of log4j.jar in in the classpath and one classloader loaded classes from one log4j.jar and another classloader loaded it from the other one. I'm not familiar with the JWSDP or which version of Tomcat is included there so I can't say anything specifically toward dealing with that product. However, you might want to check your classpath and lib/ext for copies of log4j.jar hanging around. Remove them if they are there.

If you want to verify whether the problem is in the JWSDP, download a standalone version of Tomcat-5.0.19, place log4j.jar in common/lib and log4j.properties in common/classes like you are doing. Now, if you want your app to log to the default logger repository which the server is using and risk stepping on the server's configuration (if you provide your own in the webapp), then don't do anything more a deploy your app. However, you will need to add log4j.jar to WEB-INF/lib if you want to log in your own logger repository (unless you use a custom repository selector). You should have no problem with this setup. For more info, see...

http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/AppContainerLogging

Jake

At 02:23 PM 3/10/2004 -0500, you wrote:
Hello everybody,

I'm trying to use log4j (version 1.2.8) on the Tomcat server built into Sun's JWSDP, version 1.3. I'm experiencing the same problems as reported in a previous posting to the list (from Ralf Schneider, 4 Jan 2004), i.e., the server doesn't start and reports the following error:

NoClassDefFoundError: org/apache/log4j/Logger

I did what was suggested in a reply to the posting mentioned above, which is to add the jar file of log4j to CATALINA_HOME/common/lib and a simple log4j.xml file in CATALINA_HOME/common/classes that sends messages to the console. It fixed the problem with Tomcat but I still can't see the messages I log from my own application. Here's the content of the log4j.properties file in the WEB-INF/classes directory of my application:

log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=test.log
log4j.appender.R.MaxFileSize=1MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

The output file (test.log) is not even created.

Thanks in advance for any help.

--
Denis Laroche
Pratt & Whitney Canada, Test Facilities



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to