tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avi Deitcher <>
Subject Re: log4j in webapp hanging Tomcat?
Date Mon, 03 Jul 2006 02:00:56 GMT
And Wade Chandler definitely wins the prize!

I spent days tracking down, comparing exactly how NetBeans starts it up
vs. how I do it from command prompt, and everything is identical.
However, NetBeans, when it starts, grabs stdout and pipes it to its own
in-memory cache (not sure exactly how). For whatever reason, when log4j
within a webapp (and possibly in the internal Tomcat container itself,
didn't test it enough) writes to a ConsoleAppender, it hangs. If I
switch to a FileAppender, it works beautifully.

I am not sure how NB grabs the console when it starts it via a
command-prompt, but whatever it is doing is causing the deadlock. I will
avoid it for now, but what is the right way to get NB and Tomcat
together to figure it out?

Wade Chandler wrote:

>--- Avi Deitcher <> wrote:
>>To add to it: I kept two webapps running and had
>>System.out.println(logger), where each is in the
>>same category/class, to
>>check that each one is running its own; it is. I
>>then removed every
>>webapp I could and ran it again with just the simple
>>filter + index.jsp
>>to check. Same result. Sigh.
>Try to setup a file appender and see if you get any
>remotely similar behaviour.  If not then my guess
>would be some kind of monitor is locked and code
>either in Tomcat or commons logging or log4j is
>deadlocked.  Before setting up the file appender look
>at the process for Tomcat in the windows "Task
>Manager" and see how many CPU cycles it is using at
>this point.  If it is eating up the CPU then it isn't
>a deadlock and is some infinite recursive loop (more
>than likely) some where such as your log call keeping
>on calling another log call some how down the stack or
>something weird like that.  If the CPU isn't really
>being used at all then my first guess would be a
>To start a new topic, e-mail:
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Avi Deitcher

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message