You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mike Frohme <mf...@genscape.com> on 2009/07/20 17:08:15 UTC
RE: Context.xml not updating dataSource
Sorry for the late reply, Rainer.
There is, in principle. Set deployXML to false in the Host declaration in your server.xml and it will do exactly what you want. On the flip side, tomcat will remove the configuration when the app is undeployed, so you need a little care in your deployment process.
--
Mike
-----Original Message-----
From: Rainer Frey [mailto:rainer.frey@inxmail.de]
Sent: Tuesday, June 23, 2009 3:07 AM
To: Tomcat Users List
Subject: Re: Context.xml not updating dataSource
On Monday 22 June 2009 13:53:47 Mark Thomas wrote:
> >> Edit the copy of the context.xml file and all will work as you expect.
> >
> 1. In production, the operations folks don't have to unpack the app,
> edit the context file and re-pack the app to edit the configuration.
>
> 2. When a new version of the app is installed, the environment specific
> configuration isn't lost.
>
> If you want to remove the old configuration, undeploy the app first
> which will remove the old configuration file.
A an aside, wouldn't it be nice if it were configurable whether tomcat copies
the context.xml to $CATALINA_BASE/conf? Then administrators could decide to
never have local configuration and always rely on the config within the war?
> Mark
Rainer
---------------------------------------------------------------------
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: Context.xml not updating dataSource
Posted by Mike Frohme <mf...@genscape.com>.
Sorry, Rainer - I didn't read your msg carefully, and Mark's word is right on.
Others will clarify, but as I understand it ...
The default Host attribute is deployXML "true" which means that the context.xml is deployed to conf/[engine]/[host]/appname.xml on application deployment, and undeployed appropriately. Mark's comment to "undeploy your application before you deploy the new version and Tomcat will remove the copied context.xml as part of the undeployment." is important - you may find that you are using an old context.xml if the app is not undeployed cleanly - that may have led to your original comment, I don't recall.
If deployXML is "false", your infrastructure team, or container/instance owner is responsible for maintaining resource contexts on applications' behalf - the case where backend security is a little more an issue, or "the developer doesn't really know best". Undeploying the application in this case *removes* the conf/[engine]/[host]/appname.xml, requiring manual/process intervention to restore it.
Apologies for the confusion.
--
Mike
-----Original Message-----
From: Rainer Frey [mailto:rainer.frey@inxmail.de]
Sent: Tuesday, July 21, 2009 2:40 AM
To: Tomcat Users List
Subject: Re: Context.xml not updating dataSource
On Monday 20 July 2009 17:08:15 Mike Frohme wrote:
> > > >> Edit the copy of the context.xml file and all will work as you
> > > >> expect.
> > >
> > > 1. In production, the operations folks don't have to unpack the app,
> > > edit the context file and re-pack the app to edit the configuration.
> > >
> > > 2. When a new version of the app is installed, the environment specific
> > > configuration isn't lost.
> > >
> > > If you want to remove the old configuration, undeploy the app first
> > > which will remove the old configuration file.
> >
> > A an aside, wouldn't it be nice if it were configurable whether tomcat
> > copies the context.xml to $CATALINA_BASE/conf? Then administrators could
> > decide to never have local configuration and always rely on the config
> > within the war?
> Sorry for the late reply, Rainer.
>
> There is, in principle. Set deployXML to false in the Host declaration in
> your server.xml and it will do exactly what you want. On the flip side,
> tomcat will remove the configuration when the app is undeployed, so you
> need a little care in your deployment process.
Thanks for the response. Actually, doesn't this do the exact oposite of what I
want?
What I want (as option): "I know that developer/packager did it right and I
never want to have local configuration. Always use the context.xml within the
currently deployed application, updated every time I redeploy the app."
deployXML=false seems to do: "Never trust the developer, don't even copy their
context configuration to local configuration if there is no local one yet.
Only use a configuration I manually put on the server".
Could anyone please comment whether I understand that right?
> Mike
Rainer
---------------------------------------------------------------------
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: Context.xml not updating dataSource
Posted by Mark Thomas <ma...@apache.org>.
Rainer Frey wrote:
> On Monday 20 July 2009 17:08:15 Mike Frohme wrote:
>
>>>>>> Edit the copy of the context.xml file and all will work as you
>>>>>> expect.
>>>> 1. In production, the operations folks don't have to unpack the app,
>>>> edit the context file and re-pack the app to edit the configuration.
>>>>
>>>> 2. When a new version of the app is installed, the environment specific
>>>> configuration isn't lost.
>>>>
>>>> If you want to remove the old configuration, undeploy the app first
>>>> which will remove the old configuration file.
>>> A an aside, wouldn't it be nice if it were configurable whether tomcat
>>> copies the context.xml to $CATALINA_BASE/conf? Then administrators could
>>> decide to never have local configuration and always rely on the config
>>> within the war?
>> Sorry for the late reply, Rainer.
>>
>> There is, in principle. Set deployXML to false in the Host declaration in
>> your server.xml and it will do exactly what you want. On the flip side,
>> tomcat will remove the configuration when the app is undeployed, so you
>> need a little care in your deployment process.
>
> Thanks for the response. Actually, doesn't this do the exact oposite of what I
> want?
>
> What I want (as option): "I know that developer/packager did it right and I
> never want to have local configuration. Always use the context.xml within the
> currently deployed application, updated every time I redeploy the app."
>
> deployXML=false seems to do: "Never trust the developer, don't even copy their
> context configuration to local configuration if there is no local one yet.
> Only use a configuration I manually put on the server".
>
> Could anyone please comment whether I understand that right?
You do. In which case, undeploy your application before you deploy the new
version and Tomcat will remove the copied context.xml as part of the undeployment.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Context.xml not updating dataSource
Posted by Rainer Frey <ra...@inxmail.de>.
On Monday 20 July 2009 17:08:15 Mike Frohme wrote:
> > > >> Edit the copy of the context.xml file and all will work as you
> > > >> expect.
> > >
> > > 1. In production, the operations folks don't have to unpack the app,
> > > edit the context file and re-pack the app to edit the configuration.
> > >
> > > 2. When a new version of the app is installed, the environment specific
> > > configuration isn't lost.
> > >
> > > If you want to remove the old configuration, undeploy the app first
> > > which will remove the old configuration file.
> >
> > A an aside, wouldn't it be nice if it were configurable whether tomcat
> > copies the context.xml to $CATALINA_BASE/conf? Then administrators could
> > decide to never have local configuration and always rely on the config
> > within the war?
> Sorry for the late reply, Rainer.
>
> There is, in principle. Set deployXML to false in the Host declaration in
> your server.xml and it will do exactly what you want. On the flip side,
> tomcat will remove the configuration when the app is undeployed, so you
> need a little care in your deployment process.
Thanks for the response. Actually, doesn't this do the exact oposite of what I
want?
What I want (as option): "I know that developer/packager did it right and I
never want to have local configuration. Always use the context.xml within the
currently deployed application, updated every time I redeploy the app."
deployXML=false seems to do: "Never trust the developer, don't even copy their
context configuration to local configuration if there is no local one yet.
Only use a configuration I manually put on the server".
Could anyone please comment whether I understand that right?
> Mike
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org