You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sri devops <sr...@gmail.com> on 2018/05/08 18:07:50 UTC
Help with Tomcat Automatic Application Deployment
Hello Team,
Currently I have apache-tomcat-8.5.23 installed and running on
RHEL7.x86_64. I have a war deployed and application is running under
tomcat. While application is running, if i make any manual changes to some
config files [ context.xml or server.xml or web.xml] and noticed Tomcat is
restarting application even though I haven't called tomcat service start
script.
My intention is,
1) At first when there's initial war deployed and tomcat service start
script is called, tomcat should extract war and app should work
2) Second, While tomcat is in running state and application is running and
if i make any manual changes to any tomcat config file, I do not want
application to auto magically restart.
*my server.xml looks as below*
<Host name="localhost" appBase-"webapps"
unpackWARs="true" autoDeploy="true">
I also looked at your docs and researched online, but unclear on these
parameters what to use when. [ setting autoDeploy=false (or) having
deployIgnore attribute somewhere ?]
Thanks in Advance,
Srinath
RE: Help with Tomcat Automatic Application Deployment
Posted by Jäkel,
Guido <G....@dnb.de>.
Dear Srinath,
take a look at the Configuration Elements for
/Context/WatchedResource
Probably included at the main context.xml file or the one of your application (, see https://tomcat.apache.org/tomcat-8.5-doc/config/context.html).
Greetings
Guido
>-----Original Message-----
>From: sri devops [mailto:sri.devops78@gmail.com]
>Sent: Tuesday, May 08, 2018 8:08 PM
>To: users@tomcat.apache.org
>Subject: Help with Tomcat Automatic Application Deployment
>
> Hello Team,
>
>Currently I have apache-tomcat-8.5.23 installed and running on
>RHEL7.x86_64. I have a war deployed and application is running under
>tomcat. While application is running, if i make any manual changes to some
>config files [ context.xml or server.xml or web.xml] and noticed Tomcat is
>restarting application even though I haven't called tomcat service start
>script.
>
>My intention is,
>1) At first when there's initial war deployed and tomcat service start
>script is called, tomcat should extract war and app should work
>2) Second, While tomcat is in running state and application is running and
>if i make any manual changes to any tomcat config file, I do not want
>application to auto magically restart.
>
>*my server.xml looks as below*
>
><Host name="localhost" appBase-"webapps"
> unpackWARs="true" autoDeploy="true">
>
>
>I also looked at your docs and researched online, but unclear on these
>parameters what to use when. [ setting autoDeploy=false (or) having
>deployIgnore attribute somewhere ?]
>
>Thanks in Advance,
>
>Srinath
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Help with Tomcat Automatic Application Deployment
Posted by Mark Thomas <ma...@apache.org>.
On 17/05/18 17:03, sri devops wrote:
> Sure i will work in fixing the memory leak and i have another QQ.
>
> Now that I set autoDeploy=false in order to have more control on my tomcat. I
> stopped Tomcat, deploy war file and started tomcat and tomcat is extracting
> the war just fine without having deployOnStartup attribute stated anywhere. As
> i grep for "deployOnStartup" value and couldn't find anywhere in my
> configuration, and deployments on start-up is working just fine.
>
>
> - Do i need to specifically set deployOnStartup=true, For happening
> deployments on Tomcat startup ? Or is deployOnStartup=true (by default in
> tomcat) ?
> - Also if autoDeploy is set to false, are there any other unknown
> impacts that might happen which needs to be considered ?
The configuration docs for Host can answer those questions.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Help with Tomcat Automatic Application Deployment
Posted by sri devops <sr...@gmail.com>.
Sure i will work in fixing the memory leak and i have another QQ.
Now that I set autoDeploy=false in order to have more control on my tomcat. I
stopped Tomcat, deploy war file and started tomcat and tomcat is extracting
the war just fine without having deployOnStartup attribute stated anywhere. As
i grep for "deployOnStartup" value and couldn't find anywhere in my
configuration, and deployments on start-up is working just fine.
- Do i need to specifically set deployOnStartup=true, For happening
deployments on Tomcat startup ? Or is deployOnStartup=true (by default in
tomcat) ?
- Also if autoDeploy is set to false, are there any other unknown
impacts that might happen which needs to be considered ?
Thanks,
Srinath
On Thu, May 17, 2018 at 10:48 AM Mark Thomas <ma...@apache.org> wrote:
> On 16 May 2018 23:01:14 BST, sri devops <sr...@gmail.com> wrote:
> >Thanks Mark, your answer is very helpful. I tried many scenarios using
> >your
> >inputs.
> >
> >I want Tomcat to NOT perform reload but it needs to perform a redeploy
> >when
> >context.xml is changed. So i set autoDeploy=true and commented out
> >below
> >section in context.xml to server my purpose.
> >
> ><WatchedResource>WEB-INF/web.xml</WatchedResource>
> ><WatchedResource>${catalina.base}/conf/web.xml</WatchedResources>
> >
> >Now what i noticed is, while tomcat and application are in running
> >state,
> >if i removed /opt/apache-tomcat-8.5.23/webapps/cp directory, Tomcat is
> >trying to redeploy which is good but it hung at below error
> >
> >*SEVERE: The web application [cp] created a ThreadLocal with key of
> >type
> >[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5640c1bb) and a
> >value
> >of type [foo.context.ServiceToken] (value [Unknow] ) but failed to
> >remove
> >it when the web application was stopped. Threads are going to be
> >renewed
> >over time to try and avoid a probable memory leak.*
> >
> >In order to get rid of this error, i manually need to stop / forcefully
> >kill PID for the tomcat and then start tomcat to perform a redeploy
> >---> So
> >here there's a human interaction of manually stopping tomcat and
> >starting
> >it (not serving the purpose of redeploy). Do you have any thoughts or
> >suggestions in this scenarios ?
>
> Fix the memory leak in your web application.
>
> Mark
>
>
> >
> >Thanks,
> >Srinath.
> >
> >
> >On Fri, May 11, 2018 at 11:44 AM Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 08/05/18 19:07, sri devops wrote:
> >> > Hello Team,
> >> >
> >> > Currently I have apache-tomcat-8.5.23 installed and running on
> >> > RHEL7.x86_64. I have a war deployed and application is running
> >under
> >> > tomcat. While application is running, if i make any manual changes
> >to
> >> some
> >> > config files [ context.xml or server.xml or web.xml] and noticed
> >Tomcat
> >> is
> >> > restarting application even though I haven't called tomcat service
> >start
> >> > script.
> >>
> >> Changes to server.xml do not trigger web application reload or
> >redeploy.
> >> Neither does it trigger a Tomcat restart.
> >>
> >> Changes to web.xml trigger a web application reload because of the
> >> default watched resources (see CATALINA_BASE/conf/context.xml) and
> >> because autoDeploy is true by default.
> >>
> >> Changes to context.xml will trigger a web application redeploy
> >because
> >> autoDeploy is true by default.
> >>
> >>
> >> > My intention is,
> >> > 1) At first when there's initial war deployed and tomcat service
> >start
> >> > script is called, tomcat should extract war and app should work
> >> > 2) Second, While tomcat is in running state and application is
> >running
> >> and
> >> > if i make any manual changes to any tomcat config file, I do not
> >want
> >> > application to auto magically restart.
> >> >
> >> > *my server.xml looks as below*
> >> >
> >> > <Host name="localhost" appBase-"webapps"
> >> > unpackWARs="true" autoDeploy="true">
> >> >
> >> >
> >> > I also looked at your docs and researched online, but unclear on
> >these
> >> > parameters what to use when. [ setting autoDeploy=false (or) having
> >> > deployIgnore attribute somewhere ?]
> >>
> >> Set autoDeploy to false.
> >>
> >> Mark
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Help with Tomcat Automatic Application Deployment
Posted by Mark Thomas <ma...@apache.org>.
On 16 May 2018 23:01:14 BST, sri devops <sr...@gmail.com> wrote:
>Thanks Mark, your answer is very helpful. I tried many scenarios using
>your
>inputs.
>
>I want Tomcat to NOT perform reload but it needs to perform a redeploy
>when
>context.xml is changed. So i set autoDeploy=true and commented out
>below
>section in context.xml to server my purpose.
>
><WatchedResource>WEB-INF/web.xml</WatchedResource>
><WatchedResource>${catalina.base}/conf/web.xml</WatchedResources>
>
>Now what i noticed is, while tomcat and application are in running
>state,
>if i removed /opt/apache-tomcat-8.5.23/webapps/cp directory, Tomcat is
>trying to redeploy which is good but it hung at below error
>
>*SEVERE: The web application [cp] created a ThreadLocal with key of
>type
>[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5640c1bb) and a
>value
>of type [foo.context.ServiceToken] (value [Unknow] ) but failed to
>remove
>it when the web application was stopped. Threads are going to be
>renewed
>over time to try and avoid a probable memory leak.*
>
>In order to get rid of this error, i manually need to stop / forcefully
>kill PID for the tomcat and then start tomcat to perform a redeploy
>---> So
>here there's a human interaction of manually stopping tomcat and
>starting
>it (not serving the purpose of redeploy). Do you have any thoughts or
>suggestions in this scenarios ?
Fix the memory leak in your web application.
Mark
>
>Thanks,
>Srinath.
>
>
>On Fri, May 11, 2018 at 11:44 AM Mark Thomas <ma...@apache.org> wrote:
>
>> On 08/05/18 19:07, sri devops wrote:
>> > Hello Team,
>> >
>> > Currently I have apache-tomcat-8.5.23 installed and running on
>> > RHEL7.x86_64. I have a war deployed and application is running
>under
>> > tomcat. While application is running, if i make any manual changes
>to
>> some
>> > config files [ context.xml or server.xml or web.xml] and noticed
>Tomcat
>> is
>> > restarting application even though I haven't called tomcat service
>start
>> > script.
>>
>> Changes to server.xml do not trigger web application reload or
>redeploy.
>> Neither does it trigger a Tomcat restart.
>>
>> Changes to web.xml trigger a web application reload because of the
>> default watched resources (see CATALINA_BASE/conf/context.xml) and
>> because autoDeploy is true by default.
>>
>> Changes to context.xml will trigger a web application redeploy
>because
>> autoDeploy is true by default.
>>
>>
>> > My intention is,
>> > 1) At first when there's initial war deployed and tomcat service
>start
>> > script is called, tomcat should extract war and app should work
>> > 2) Second, While tomcat is in running state and application is
>running
>> and
>> > if i make any manual changes to any tomcat config file, I do not
>want
>> > application to auto magically restart.
>> >
>> > *my server.xml looks as below*
>> >
>> > <Host name="localhost" appBase-"webapps"
>> > unpackWARs="true" autoDeploy="true">
>> >
>> >
>> > I also looked at your docs and researched online, but unclear on
>these
>> > parameters what to use when. [ setting autoDeploy=false (or) having
>> > deployIgnore attribute somewhere ?]
>>
>> Set autoDeploy to false.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Help with Tomcat Automatic Application Deployment
Posted by sri devops <sr...@gmail.com>.
Thanks Mark, your answer is very helpful. I tried many scenarios using your
inputs.
I want Tomcat to NOT perform reload but it needs to perform a redeploy when
context.xml is changed. So i set autoDeploy=true and commented out below
section in context.xml to server my purpose.
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResources>
Now what i noticed is, while tomcat and application are in running state,
if i removed /opt/apache-tomcat-8.5.23/webapps/cp directory, Tomcat is
trying to redeploy which is good but it hung at below error
*SEVERE: The web application [cp] created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5640c1bb) and a value
of type [foo.context.ServiceToken] (value [Unknow] ) but failed to remove
it when the web application was stopped. Threads are going to be renewed
over time to try and avoid a probable memory leak.*
In order to get rid of this error, i manually need to stop / forcefully
kill PID for the tomcat and then start tomcat to perform a redeploy ---> So
here there's a human interaction of manually stopping tomcat and starting
it (not serving the purpose of redeploy). Do you have any thoughts or
suggestions in this scenarios ?
Thanks,
Srinath.
On Fri, May 11, 2018 at 11:44 AM Mark Thomas <ma...@apache.org> wrote:
> On 08/05/18 19:07, sri devops wrote:
> > Hello Team,
> >
> > Currently I have apache-tomcat-8.5.23 installed and running on
> > RHEL7.x86_64. I have a war deployed and application is running under
> > tomcat. While application is running, if i make any manual changes to
> some
> > config files [ context.xml or server.xml or web.xml] and noticed Tomcat
> is
> > restarting application even though I haven't called tomcat service start
> > script.
>
> Changes to server.xml do not trigger web application reload or redeploy.
> Neither does it trigger a Tomcat restart.
>
> Changes to web.xml trigger a web application reload because of the
> default watched resources (see CATALINA_BASE/conf/context.xml) and
> because autoDeploy is true by default.
>
> Changes to context.xml will trigger a web application redeploy because
> autoDeploy is true by default.
>
>
> > My intention is,
> > 1) At first when there's initial war deployed and tomcat service start
> > script is called, tomcat should extract war and app should work
> > 2) Second, While tomcat is in running state and application is running
> and
> > if i make any manual changes to any tomcat config file, I do not want
> > application to auto magically restart.
> >
> > *my server.xml looks as below*
> >
> > <Host name="localhost" appBase-"webapps"
> > unpackWARs="true" autoDeploy="true">
> >
> >
> > I also looked at your docs and researched online, but unclear on these
> > parameters what to use when. [ setting autoDeploy=false (or) having
> > deployIgnore attribute somewhere ?]
>
> Set autoDeploy to false.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Help with Tomcat Automatic Application Deployment
Posted by Mark Thomas <ma...@apache.org>.
On 08/05/18 19:07, sri devops wrote:
> Hello Team,
>
> Currently I have apache-tomcat-8.5.23 installed and running on
> RHEL7.x86_64. I have a war deployed and application is running under
> tomcat. While application is running, if i make any manual changes to some
> config files [ context.xml or server.xml or web.xml] and noticed Tomcat is
> restarting application even though I haven't called tomcat service start
> script.
Changes to server.xml do not trigger web application reload or redeploy.
Neither does it trigger a Tomcat restart.
Changes to web.xml trigger a web application reload because of the
default watched resources (see CATALINA_BASE/conf/context.xml) and
because autoDeploy is true by default.
Changes to context.xml will trigger a web application redeploy because
autoDeploy is true by default.
> My intention is,
> 1) At first when there's initial war deployed and tomcat service start
> script is called, tomcat should extract war and app should work
> 2) Second, While tomcat is in running state and application is running and
> if i make any manual changes to any tomcat config file, I do not want
> application to auto magically restart.
>
> *my server.xml looks as below*
>
> <Host name="localhost" appBase-"webapps"
> unpackWARs="true" autoDeploy="true">
>
>
> I also looked at your docs and researched online, but unclear on these
> parameters what to use when. [ setting autoDeploy=false (or) having
> deployIgnore attribute somewhere ?]
Set autoDeploy to false.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org