tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: tomcat randomly undeploys and redeploys the applications
Date Thu, 03 Apr 2014 16:06:35 GMT
Hash: SHA256


On 4/2/14, 5:20 PM, Mark Eggers wrote:
> Chris,
> On 4/2/2014 1:54 PM, Christopher Schultz wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> Mark,
>> On 4/2/14, 4:30 PM, Mark Eggers wrote:
>>> Chris,
>>> On 4/2/2014 1:05 PM, Christopher Schultz wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>>>> Chuck,
>>>> On 4/2/14, 8:21 AM, Caldarale, Charles R wrote:
>>>>>> From: Elias Kopsiaftis []
>>>>>> Subject: tomcat randomly undeploys and redeploys the
>>>>>> applications
>>>>>> I deploy the application, then in the log file
>>>>>> catalina.out i get many messages from WebappClassLoader 
>>>>>> clearReferencesThreads saying threads appear to have
>>>>>> started but have failed to stop
>>>>> This is an indication that your webapp is not managing its 
>>>>> threads properly.
>>>>>> then finally, Ill get a message from HostConfig 
>>>>>> checkResources that says its undeploying the context,
>>>>>> and then it redeploys.
>>>>> This is sometimes caused by incorrect timestamps on the
>>>>> bits of the webapp that Tomcat monitors, or an incorrect
>>>>> clock setting on the system Tomcat is running on.  The
>>>>> mismatch makes it appear that the webapp is being updated
>>>>> continuously.
>>>> I've found that in development, a single update can cause
>>>> Tomcat to go into a loop of redeployments, re-deploying my
>>>> web application every few seconds or so. If I let it go, it
>>>> does finally stop reloading and settle down.
>>> Can you describe your development environment a little bit,
>>> and any thoughts as to what might trigger this loop of
>>> redeployments?
>> I use Eclipse for development, but our "real" build process is 
>> ant-based. We have some watched resources configured outside the 
>> default (stuff like Struts config files, etc.).
> Ah, makes sense.
>> When I do a build while Tomcat is running, usually I get one
>> webapp reload, but sometimes I get a series of reloads. It
>> usually gets so irritating (our webapp takes about 10 seconds to
>> reload) that I just kill Tomcat and immediately restart it. It
>> starts up once and all is well after that.
> Yep, and in the process more files are copied about, and that
> triggers another reload.
> Fun, fun.

No, the deployment update takes like one or two seconds. It's usually
something like copying less than 10 class files or whatever. It's
nearly instantaneous. Whatever happens, it's not because I'm updating
files during the reload. I could understand that situation.

What I observe is that I update my application, I wait maybe 10
seconds, and then Tomcat reloads my application multiple times before
I just kill it.

>>> I've not seen this, but it could explain some issues some the 
>>> developers I support are seeing.
>> It definitely happens, and I never remember to enable the DEBUG 
>> logging to find out what resource it thinks has been updated
>> until after it happens, at which point I just don't care. Perhaps
>> I should enable it right now :)
>> - -chris
> I've managed to make this happen in my environment now (NetBeans
> 7.4, Maven 3.2.1, Tomcat 7.0.42 - all will be upgraded soon). I
> just needed an application that takes a bit longer to load. I only
> managed to trigger two reloads, so it's not much of an issue.
> Maybe look at adding the backgroundProcessorDelay attribute to the 
> context? I don't know what would happen if the context got a string
> of reload requests within the delay interval. Would it queue them
> up one after the other, or would it just execute one?

I think it's more important to see what file(s) Tomcat thinks is(are)
being updated. I wonder if it's the same file, or if there's some
weird timestamp issue happening. Perhaps there is even some kind of
edge case where a resource's last-modified date isn't being updated

In most cases, Tomcat reloads my application a single time, as
expected. These reload-storms are fairly rare.

- -chris
Version: GnuPG v1
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message