You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Austin <ma...@revolsys.com> on 2005/08/25 23:37:19 UTC
Automatic deploy of updated war deletes the context file
When I copy an updated copy of a war file that was deployed with a
context.xml file in the META-INF directory and also I have a copy of the
context.xml in the conf/Catalina/<host> directory the deployer just
deletes the context altogether and doesn't reploy the application.
How is this supposed to work, the only guess I can have as to why this
doesn't work is that tomcat detects the file change half way through the
file is being copied, undeploys the old application deleting the context
file and then barfs on reading the half copied war file and just gives
up and there is nothing in the logs to say what is going on.
The way I fix this is to then manually copy in the context file and then
it deploys, for now I'm just going to wait about 10 seconds in my ant
deploy script after copying the file and then copy the context in so it
redeploys.
Paul
Re: Automatic deploy of updated war deletes the context file
Posted by Hassan Schroeder <ha...@webtuitive.com>.
Paul Austin wrote:
> Now the final question is how can I set the path to be a sub directory?
> So /subdir/app. This worked on my Tomcat 5 installation on Linux but
> doesn't work here. It seems to just ignore the path.
No idea, never had a reason to try such a configuration -- sorry!
--
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
dream. code.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy of updated war deletes the context file
Posted by Paul Austin <ma...@revolsys.com>.
I know almost have it 'The way I want it to work (TM)' using the
following configuration.
- server.xml
<Host appBase="wars/<host>" autoDeploy="false" debug="99"
name="<host>" unpackWARs="false" deployXML="false"
>
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="<host>" timestamp="false" />
</Host>
- conf/Catalina/<host>/app.xml
<?xml version='1.0' encoding='utf-8'?>
<Context debug="9" docBase="app-web.war" path="/app"
reloadable="true"
>
<ResourceLink global="jdbc/appDs" name="jdbc/appDs"
type="javax.sql.DataSource"
/>
</Context>
Now the final question is how can I set the path to be a sub directory?
So /subdir/app. This worked on my Tomcat 5 installation on Linux but
doesn't work here. It seems to just ignore the path.
And YES these context files are NOT deployed as part of the war file.
On Fri, 2005-08-26 at 08:33 -0700, Hassan Schroeder wrote:
> Paul Austin wrote:
> > The test case I am using is running on Tomcat 5.5.9.
> >
> > 1. The web application is deployed as a the app.war file, with no
> > context.xml file to the wars/<host> directory
>
> _and_ no META-INF/context.xml in the war file, right?
>
> > 2. The Host configuration is as follows.
> > <Host debug="99" name="<host>" unpackWARs="false"
> > deployXML="false">
> > <Logger className="org.apache.catalina.logger.FileLogger"
> > prefix="<host>" timestamp="false" />
> > </Host>
> > 3. In conf/Catalina/<host>/app.xml
> > <?xml version='1.0' encoding='utf-8'?>
> > <Context debug="9" docBase="wars/<host>/app.war" path="/app"
> > reloadable="true" workDir="work/Catalina/<host>/app">
> > <ResourceLink global="jdbc/appDs" name="jdbc/appDs"
> > type="javax.sql.DataSource"/>
> > </Context>
> >
> > When I copy app.war into wars/<host> to repeploy using the automatic
> > deployer I check the conf/Catalina/<host>/ and
> > http://<host>/manager/list and the app.xml and the /app context are
> > deleted.
>
> I would check your logs for errors, but also go through all your
> entries in your server.xml and "app".xml files
>
> For instance, for the path attribute of Context:
> The value of this field must not be set except when statically
> defining a Context in server.xml, as it will be infered from the
> filenames used for either the .xml context file or the docBase.
>
> Sometimes the subtle config errors will bite'cha :-)
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy of updated war deletes the context file
Posted by Hassan Schroeder <ha...@webtuitive.com>.
Paul Austin wrote:
> The test case I am using is running on Tomcat 5.5.9.
>
> 1. The web application is deployed as a the app.war file, with no
> context.xml file to the wars/<host> directory
_and_ no META-INF/context.xml in the war file, right?
> 2. The Host configuration is as follows.
> <Host debug="99" name="<host>" unpackWARs="false"
> deployXML="false">
> <Logger className="org.apache.catalina.logger.FileLogger"
> prefix="<host>" timestamp="false" />
> </Host>
> 3. In conf/Catalina/<host>/app.xml
> <?xml version='1.0' encoding='utf-8'?>
> <Context debug="9" docBase="wars/<host>/app.war" path="/app"
> reloadable="true" workDir="work/Catalina/<host>/app">
> <ResourceLink global="jdbc/appDs" name="jdbc/appDs"
> type="javax.sql.DataSource"/>
> </Context>
>
> When I copy app.war into wars/<host> to repeploy using the automatic
> deployer I check the conf/Catalina/<host>/ and
> http://<host>/manager/list and the app.xml and the /app context are
> deleted.
I would check your logs for errors, but also go through all your
entries in your server.xml and "app".xml files
For instance, for the path attribute of Context:
The value of this field must not be set except when statically
defining a Context in server.xml, as it will be infered from the
filenames used for either the .xml context file or the docBase.
Sometimes the subtle config errors will bite'cha :-)
--
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
dream. code.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy of updated war deletes the context file
Posted by Remy Maucherat <re...@gmail.com>.
On 8/26/05, Paul Austin <ma...@revolsys.com> wrote:
> The test case I am using is running on Tomcat 5.5.9.
>
> 1. The web application is deployed as a the app.war file, with no
> context.xml file to the wars/<host> directory
> 2. The Host configuration is as follows.
> <Host debug="99" name="<host>" unpackWARs="false"
> deployXML="false">
> <Logger className="org.apache.catalina.logger.FileLogger"
> prefix="<host>" timestamp="false" />
> </Host>
> 3. In conf/Catalina/<host>/app.xml
> <?xml version='1.0' encoding='utf-8'?>
> <Context debug="9" docBase="wars/<host>/app.war" path="/app"
> reloadable="true" workDir="work/Catalina/<host>/app">
> <ResourceLink global="jdbc/appDs" name="jdbc/appDs"
> type="javax.sql.DataSource"/>
> </Context>
>
> When I copy app.war into wars/<host> to repeploy using the automatic
> deployer I check the conf/Catalina/<host>/ and
> http://<host>/manager/list and the app.xml and the /app context are
> deleted.
Yes, this is normal.
--
xxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
xxxxxxxxxxxxxxxxxxxxxxxxx
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy of updated war deletes the context file
Posted by Paul Austin <ma...@revolsys.com>.
The test case I am using is running on Tomcat 5.5.9.
1. The web application is deployed as a the app.war file, with no
context.xml file to the wars/<host> directory
2. The Host configuration is as follows.
<Host debug="99" name="<host>" unpackWARs="false"
deployXML="false">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="<host>" timestamp="false" />
</Host>
3. In conf/Catalina/<host>/app.xml
<?xml version='1.0' encoding='utf-8'?>
<Context debug="9" docBase="wars/<host>/app.war" path="/app"
reloadable="true" workDir="work/Catalina/<host>/app">
<ResourceLink global="jdbc/appDs" name="jdbc/appDs"
type="javax.sql.DataSource"/>
</Context>
When I copy app.war into wars/<host> to repeploy using the automatic
deployer I check the conf/Catalina/<host>/ and
http://<host>/manager/list and the app.xml and the /app context are
deleted.
On Thu, 2005-08-25 at 16:32 -0700, Hassan Schroeder wrote:
> Paul Austin wrote:
> > Right but where should it go so that tomcat doesn't delete it?
> >
> > I've tried setting the deployXML="false" on the host and having it just
> > in the conf/Catalina/<host> directory (which is my preferred location),
> > just in the war file and all various combinations.
>
> I've used both locations -- separately! -- without problems. Are you
> saying that with *only* /conf/Catalina/<host>/<context>.xml, nothing
> in META-INF/context.xml, your deployment fails and the <context>.xml
> file is removed?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy of updated war deletes the context file
Posted by Hassan Schroeder <ha...@webtuitive.com>.
Paul Austin wrote:
> Right but where should it go so that tomcat doesn't delete it?
>
> I've tried setting the deployXML="false" on the host and having it just
> in the conf/Catalina/<host> directory (which is my preferred location),
> just in the war file and all various combinations.
I've used both locations -- separately! -- without problems. Are you
saying that with *only* /conf/Catalina/<host>/<context>.xml, nothing
in META-INF/context.xml, your deployment fails and the <context>.xml
file is removed?
--
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
dream. code.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Automatic deploy of updated war deletes the context file
Posted by Paul Austin <ma...@revolsys.com>.
Right but where should it go so that tomcat doesn't delete it?
I've tried setting the deployXML="false" on the host and having it just
in the conf/Catalina/<host> directory (which is my preferred location),
just in the war file and all various combinations.
Paul
On Thu, 2005-08-25 at 15:44 -0700, Hassan Schroeder wrote:
> So Paul Austin says: Doctor,
> > When I copy an updated copy of a war file that was deployed with a
> > context.xml file in the META-INF directory and also I have a copy of the
> > context.xml in the conf/Catalina/<host> directory the deployer just
> > deletes the context altogether and doesn't reploy the application.
>
> ..and the Doctor says: "Right, so don't do that".
>
> /* Heh. Vaudeville :-) */
>
> Seriously, you only want to have your Context defined *one* place.
>
Re: Automatic deploy of updated war deletes the context file
Posted by Hassan Schroeder <ha...@webtuitive.com>.
So Paul Austin says: Doctor,
> When I copy an updated copy of a war file that was deployed with a
> context.xml file in the META-INF directory and also I have a copy of the
> context.xml in the conf/Catalina/<host> directory the deployer just
> deletes the context altogether and doesn't reploy the application.
..and the Doctor says: "Right, so don't do that".
/* Heh. Vaudeville :-) */
Seriously, you only want to have your Context defined *one* place.
--
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
dream. code.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org