Strange logging error for 4.1.18

2003-03-14 Thread William Lee
I'm running Tomcat 4.1.18 on Solaris 8 and Sun's JRE 1.3.x.  I tried 
searching for the list but I couldn't seem to find anything that'll 
describe this problem.

Usually, I can start tomcat fine.  However, it seems like once in a 
while I got this error from stdout:

org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: Class 
org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:567)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:291)
at 
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:415)
at 
org.apache.tomcat.util.log.CommonLogHandler.log(CommonLogHandler.java:97)
at org.apache.tomcat.util.log.Log.log(Log.java:198)
at org.apache.tomcat.util.log.Log.log(Log.java:192)
at org.apache.tomcat.util.log.Log.log(Log.java:174)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:484)

Then Tomcat stops accepting connection and just hung there.  Looking at 
the ThreadPool.java code I see around line 522:

/* Check if should execute a runnable.  */
try {
if(noThData) {
if(p.debug0) p.log( Getting new thread 
data);
thData=toRun.getInitData();
noThData = false;
}

if(shouldRun) {
toRun.runIt(thData);
}
} catch(Throwable t) {
loghelper.log(Caught exception executing  + 
toRun.toString() + , terminating thread, t);
loghelper.flush();
/*
* The runnable throw an exception (can be even 
a ThreadDeath),
* signalling that the thread die.
*
* The meaning is that we should release the thread from
* the pool.
*/

It seems to throw another exception on the loghelper.log() call inside 
the catch(Throwable t) block.  From here I suspect class loading issues, 
but I couldn't figure out what is wrong.   Note that I'm compiling 
Tomcat from source using common-logging 1.0.2 and log4j 1.2.6.   I 
didn't include log4j in the tomcat distribution (not in server/lib) but 
I do have a servlet that uses log4j1.2.6 and have the jar in the 
WEB-INF/lib directory.

Does somebody experience anything like this before?

--
William Lee (Will)| Sendmail Inc.
Email:  [EMAIL PROTECTED] | http://www.sendmail.com
Tel:(510) 594-5505|
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[Fwd: Re: Tomcat 4.1.12 hanging under stress?]

2002-10-30 Thread William Lee
I've posted this on tomcat-user, but I can't seem to find the answer...

My setup:

Tomcat 4.1.12, Linux 2.4.9, IBM JRE 1.3.1, running Standalone SSL Coyote 
conntector.

My problem is, I've tried to stress test my application and with 
moderate load (20 concurrent connections) for a short time (around 1 
minute), somehow the port I opened would stop responding.  I can still 
connect to the port, but it does not do anything.

After trying various different JREs, -X flags, and garbage collection
info, etc, I updated my tomcat to 4.1.14 (test) and now I got the
following exception in stdout when I got into the situation where the
connection hung.  Note that I printed out this stack trace myself on 
around line 533, where the exception was thrown:

Class org.apache.commons.logging.impl.Log4JCategoryLog does not
implement Log
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:555)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:289)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
at org.apache.tomcat.util.log.CommonLogHandler.log(CommonLogHandler.java:97)
at org.apache.tomcat.util.log.Log.log(Log.java:198)
at org.apache.tomcat.util.log.Log.log(Log.java:192)
at org.apache.tomcat.util.log.Log.log(Log.java:165)
at org.apache.tomcat.util.threads.ThreadPool.logFull(ThreadPool.java:260)
at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:226)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:509)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:512)


Looking into the 4.1.14 source code, it turned out that the thread 
(maybe the connection dispatcher thread?) just died when calling the 
function logFull(), which happened if all workers are busy, and somehow 
log4j failed to do its job (?).  After this, there is no more thread 
trying to take the incoming connection and that's quite bad.  The JVM is 
still running OK and I can shutdown the server correctly.  Everything 
are just waiting, however.

Does this have anything to do with class loader and using different 
versions of log4j?  Does anyone know how tomcat logged its messages? 
Note that this does not happen 100% of the time, sometimes it does log 
the message successfully.  I suspect there're some thread related issues 
here.

I tried commenting out the logFull call and all seem to work ok.  What I 
don't understand is, will this problem occur elsewhere when it's trying 
to log that message?

--
William Lee (Will)| Sendmail Inc.
Email:  [EMAIL PROTECTED] | http://www.sendmail.com
Tel:(510) 594-5505|


--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org