You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nick Pellow <ni...@mindmatics.de> on 2004/11/05 15:47:38 UTC

META-INF/context.xml not overwriting Catalina/localhost/webapp.xml after redeploy.

Hi,

I am using a META-INF/context.xml in each of my webapps to define
Resource-Links to global resources defined in my server.xml. (Tomcat 5.0.28)

Upon the initial deployment of the war, tomcate creates a copy of this
context.xml
under $CATALINA_HOME/conf/[enginename]/[hostname]/ called webappname.xml .

When i then redeploy the same webapp ('webappname'), with a
META-INF/context.xml,
$CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml  does not get
updated.
Is there a means to enable this under Tomcat 5.0.28, or is this a security
feature?

Cheers,
Nick.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: META-INF/context.xml not overwriting Catalina/localhost/webapp.xml after redeploy.

Posted by Michael Echerer <me...@tngtech.com>.

Steve Kirk wrote:

> Remy mentioned earlier today on another thread that the path is ignored in a
> context.xml file because it is redundant, but I _think_ he was talking about
> 5.5 rather than 5.0.  I have deleted the post now but I think he said that
> the docBase is probably also ignored.  search the archive to check me on
> that.
Well, the "path" of <Context> is ignored when deploying a .WAR file with 
META-INF/context.xml, because Tomcat 5.x (not yet tried 5.5, but I think 
  this behaviour was even in Tomcat 4.x) takes the .war's file name as 
context path. There is no way to change this, I tried it, didn't work.





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: META-INF/context.xml not overwriting Catalina/localhost/webapp.xml after redeploy.

Posted by Steve Kirk <to...@web-startup.co.uk>.
Remy mentioned earlier today on another thread that the path is ignored in a
context.xml file because it is redundant, but I _think_ he was talking about
5.5 rather than 5.0.  I have deleted the post now but I think he said that
the docBase is probably also ignored.  search the archive to check me on
that.

In any case on v5 I think it's OK for docBase to point to either the open
filesystem or the war (given that once the war is unpacked, they both
exist).  Mine points to the war, but that's just my choice, it's not for any
special reason.

> -----Original Message-----
> From: Nick Pellow [mailto:nick.pellow@mindmatics.de] 
> Sent: Friday 05 November 2004 15:39
> To: Tomcat Users List
> Subject: AW: META-INF/context.xml not overwriting 
> Catalina/localhost/webapp.xml after redeploy.
> 
> 
> Hi Steve,
> 
> >
> >That file is only updated in certain circumstances.  check that your
> >circumstances fit those.  here's a good place to start:
> >http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Au
> >tomatic%2
> >0Application%20Deployment
> 
> Ok. I see...
> 
> >
> >I adopted the habit of restarting with a script, which deletes the
> >$CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml files then
> >restarts TC.  Just to be sure.
> 
> I figured this would be the case.
> 
> >
> >also, when you say that context.xml is within META-INF, is 
> this within a
> >war, or an open filesystem?  (It needs to be in a warfile).
> 
> I am using a warfile, however, it does get expanded to the webapps
> directory, so
> there is also an open filesystem. Should my docbase be 
> pointing to the .war
> in my
> context.xml, and not the directory?
> 
> 
> >
> >> -----Original Message-----
> >> From: Nick Pellow [mailto:nick.pellow@mindmatics.de]
> >> Sent: Friday 05 November 2004 14:48
> >> To: Tomcat Users List
> >> Subject: META-INF/context.xml not overwriting
> >> Catalina/localhost/webapp.xml after redeploy.
> >>
> >>
> >> Hi,
> >>
> >> I am using a META-INF/context.xml in each of my webapps to define
> >> Resource-Links to global resources defined in my server.xml.
> >> (Tomcat 5.0.28)
> >>
> >> Upon the initial deployment of the war, tomcate creates a 
> copy of this
> >> context.xml
> >> under $CATALINA_HOME/conf/[enginename]/[hostname]/ called
> >> webappname.xml .
> >>
> >> When i then redeploy the same webapp ('webappname'), with a
> >> META-INF/context.xml,
> >> $CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml
> >> does not get
> >> updated.
> >> Is there a means to enable this under Tomcat 5.0.28, or is
> >> this a security
> >> feature?
> >>
> >> Cheers,
> >> Nick.
> >>
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


AW: META-INF/context.xml not overwriting Catalina/localhost/webapp.xml after redeploy.

Posted by Nick Pellow <ni...@mindmatics.de>.
Hi Steve,

>
>That file is only updated in certain circumstances.  check that your
>circumstances fit those.  here's a good place to start:
>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Au
>tomatic%2
>0Application%20Deployment

Ok. I see...

>
>I adopted the habit of restarting with a script, which deletes the
>$CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml files then
>restarts TC.  Just to be sure.

I figured this would be the case.

>
>also, when you say that context.xml is within META-INF, is this within a
>war, or an open filesystem?  (It needs to be in a warfile).

I am using a warfile, however, it does get expanded to the webapps
directory, so
there is also an open filesystem. Should my docbase be pointing to the .war
in my
context.xml, and not the directory?


>
>> -----Original Message-----
>> From: Nick Pellow [mailto:nick.pellow@mindmatics.de]
>> Sent: Friday 05 November 2004 14:48
>> To: Tomcat Users List
>> Subject: META-INF/context.xml not overwriting
>> Catalina/localhost/webapp.xml after redeploy.
>>
>>
>> Hi,
>>
>> I am using a META-INF/context.xml in each of my webapps to define
>> Resource-Links to global resources defined in my server.xml.
>> (Tomcat 5.0.28)
>>
>> Upon the initial deployment of the war, tomcate creates a copy of this
>> context.xml
>> under $CATALINA_HOME/conf/[enginename]/[hostname]/ called
>> webappname.xml .
>>
>> When i then redeploy the same webapp ('webappname'), with a
>> META-INF/context.xml,
>> $CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml
>> does not get
>> updated.
>> Is there a means to enable this under Tomcat 5.0.28, or is
>> this a security
>> feature?
>>
>> Cheers,
>> Nick.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: META-INF/context.xml not overwriting Catalina/localhost/webapp.xml after redeploy.

Posted by Steve Kirk <to...@web-startup.co.uk>.
That file is only updated in certain circumstances.  check that your
circumstances fit those.  here's a good place to start: 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Automatic%2
0Application%20Deployment 

I adopted the habit of restarting with a script, which deletes the
$CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml files then
restarts TC.  Just to be sure.

also, when you say that context.xml is within META-INF, is this within a
war, or an open filesystem?  (It needs to be in a warfile).

> -----Original Message-----
> From: Nick Pellow [mailto:nick.pellow@mindmatics.de] 
> Sent: Friday 05 November 2004 14:48
> To: Tomcat Users List
> Subject: META-INF/context.xml not overwriting 
> Catalina/localhost/webapp.xml after redeploy.
> 
> 
> Hi,
> 
> I am using a META-INF/context.xml in each of my webapps to define
> Resource-Links to global resources defined in my server.xml. 
> (Tomcat 5.0.28)
> 
> Upon the initial deployment of the war, tomcate creates a copy of this
> context.xml
> under $CATALINA_HOME/conf/[enginename]/[hostname]/ called 
> webappname.xml .
> 
> When i then redeploy the same webapp ('webappname'), with a
> META-INF/context.xml,
> $CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml  
> does not get
> updated.
> Is there a means to enable this under Tomcat 5.0.28, or is 
> this a security
> feature?
> 
> Cheers,
> Nick.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: META-INF/context.xml not overwriting Catalina/localhost/webapp.xml after redeploy.

Posted by sven morales <ak...@yahoo.com>.
     We keep forgetting that Before the war gets
unpacked, Tomcat checks if there is an existing
directory with the same name as the war file or same
name as the "path" attribute of the <Context> file,
and if it exist the war file does not get expanded and
it just attempts to work of of off the existing
directory (with same name as the war file).  At least
this has been my experience with tomcat since 4.0.x
     As suggested by others, to deploy a war file,
make sure there are no directory in webapps that has
same name as the war file. In addition, you also want
to delete the "work" area under  tomcat/work/xx/xx 
where xx is the directory where tomcat puts the
working classes, cache and resources.

  
--- Nick Pellow <ni...@mindmatics.de> wrote:

> Hi,
> 
> I am using a META-INF/context.xml in each of my
> webapps to define
> Resource-Links to global resources defined in my
> server.xml. (Tomcat 5.0.28)
> 
> Upon the initial deployment of the war, tomcate
> creates a copy of this
> context.xml
> under $CATALINA_HOME/conf/[enginename]/[hostname]/
> called webappname.xml .
> 
> When i then redeploy the same webapp ('webappname'),
> with a
> META-INF/context.xml,
>
$CATALINA_HOME/conf/[enginename]/[hostname]/webappname.xml
>  does not get
> updated.
> Is there a means to enable this under Tomcat 5.0.28,
> or is this a security
> feature?
> 
> Cheers,
> Nick.
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org