Hello.

I apologize for sending this to the dev list, but I'm not sure 
where else to turn and would like a clarification from the 
developers before I make changes to my deployment process.

The following thread was posted yesterday on the users list. 
Comments from me follow.


-----Original Message-----
From: John H [mailto:[EMAIL PROTECTED]
Sent: Monday, April 12, 2004 2:42 PM
To: [EMAIL PROTECTED]
Subject: Tomcat 5 and Context Descriptors

Good afternoon,

We are currently looking at upgrading our Tomcat 4.1.24 
installation to 5.0.19. I've installed a test environment to see 
what sort of migration issues there will be, and so far I've only 
encountered one.

Under 4.1.24, we have a <Host> entry in server.xml that looks like 
this:

<Host name="localhost" appBase="C:\localwebapps\conf"   
      unpackWARs="true" autoDeploy="true"
      deployXML="true">
...
</Host>

This allowed us to place context descriptors in 
C:\localwebapps\conf (XML files with individual <Context> tags, 
one file for each Context), and these contexts would be loaded at 
startup.

With 5.0.19, I modified the <Host> entry to look like this:

<Host name="localhost" appBase="C:\localwebapps\conf" 
      unpackWARs="true" autoDeploy="true"
      deployXML="true" deployOnStartup="true">
...
</Host>

However, the context descriptors in C:\localwebapps\conf are not 
loaded at startup, and I can't seem to figure out how to load them 
at all. The only way to load them is to place them in
$CATALINA_HOME/conf/[enginename]/[hostname]/

I'm assuming I'm missing something, since I doubt that Tomcat 5 
would force you to use $CATALINA_HOME/conf/[enginename]/
[hostname]/ for context descriptors.

Looking through the Deployment HOWTO, the Context Descriptors 
heading has this blurb:

A Context XML descriptor is a fragment of XML data which contains 
a valid Context element which would normally be found in the main 
server configuration file (conf/server.xml), and allows easy and 
automated manipulation of web applications by the various 
management tools available in Tomcat. For a given host, the
Context descriptors are located in $CATALINA_HOME/conf/
[enginename]/[hostname]/foo.xml. Note that while the
name of the file is not tied to the webapp name, Tomcat will 
create Context descriptors which match the webapp name whenever it 
will generate a Context descriptor.

This seems to indicate that I have to use $CATALINA_HOME/conf/
[enginename]/[hostname]/. However, the very next heading, 
'Deploying Tomcat on Startup', has this to say: 

The webapps which are present in the host appBase will be deployed 
if the host "deployOnStartup" property is true. The deployment 
process is the following:

  a.. The Context XML declarations will be deployed first
  b.. ...

This seems to indicate that I should be able to do what I want to 
do.


Any ideas?

John

----- Follow Up 1 ----- 
From: "Shapira, Yoav" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, April 12, 2004 2:42 PM
Subject: RE: Tomcat 5 and Context Descriptors

Hi,
If you use context .xml files, you can put them in
$CATALINA_HOME/conf/[engine name]/[host name] or in the META-INF
directory of the WAR file representing your webapp.

If you're just deploying webapps without a context XML file, you can put
them in the host's appBase.  Then you don't need any XML file for your
context.

But you can't just put context XML files in the host's appBase.

Yoav Shapira
Millennium Research Informatics

----- Follow Up 2 ----- 

a.. From: John H 
a.. Subject: Re: Tomcat 5 and Context Descriptors 
a.. Date: Mon, 12 Apr 2004 12:00:36 -0700 

Is this something new in TC5? Context XML's in appBase worked in 4.1.24.

----- Follow Up 3 ----- 
a.. From: Shapira, Yoav 
a.. Subject: RE: Tomcat 5 and Context Descriptors 
a.. Date: Mon, 12 Apr 2004 12:04:33 -0700 

Yup, the move from appBase to conf/[engine name]/[host name] is a change
in TC5.

Comments:

It appears that I've lost the ability to store context descriptors outside the tomcat 
tree, unless they are inside the META-INF directory of the WAR file. Is this correct? 

I can see a case where a user a) may not have access to the tomcat tree and b) wants 
to be able to freely move a WAR file to different servers with different context 
parameters without having to modify the WAR.

Hopefully there is a workaround. 

Again, sorry for bugging the dev list. I just wanted a clarification.

Thanks,

John Hutchinson

Reply via email to