You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by li...@free.fr on 2006/09/13 16:52:13 UTC

tomcat deployment changes since Tomcat 5.5.12

Hi all,

I tested several tomcat versions (TC5.5.7->TC5.5.17) and, when deploying my webapps, I don't see the same behaviour in these versions for the ROOT contexts.
The tomcat versions >= TC5.5.12 don't have the same behaviour and I don't know if it is a bug or not

So, can anybody can say to me if it is a bug or what are the correct parameters for my needs ?

My tests :
In my needs, on production environments, I want to deploy my webapp on a Host under the path / . 
I use external Context files and I'd want the manager (or deployer) to unpack automatically my war.

1) To deploy myWebApp.war for tests on http://myvhost/mywebapp/, I succeed with :

Host parameter :
	unpackWARS=true
 	autodeploy=true
 	deployOnStartup=true
 	deployXML=true
 	appBase=/usr2/web/myhost	(for example)
Context Parameters :
 	path=/myWebApp
 	docBase=/usr2/web/myhost/myWebApp

All is OK for TC 5.5.7 -> TC 5-5-17:
 	myWebApp.xml copied in $CATALINA_HOME/conf/[Engine]/myvhost/, 
 	myWebApp.war copied in /usr2/web/myhost		(=Host.appBase)
 	myWebApp.war unpacked under /usr2/web/myhost/myWebApp,
 	tests OK
 
2) To deploy ROOT.war for tests on http://myvhost/, I succeed with :

2.1) For TC 5.5.7 -> 5.5.9 :
Host parameters :
	unpackWARS=true
 	autodeploy=true
 	deployOnStartup=true
 	deployXML=true
 	appBase=/usr2/web/myhost	(for example)
Context Parameters :
 	path=""
 	docBase=/usr2/web/myhost/ROOT.war

All is OK :
 	ROOT.xml copied in $CATALINA_HOME/conf/[Engine]/myvhost/, 
 	ROOT.war copied in /usr2/web/myhost		(=Host.appBase)
 	ROOT.war unpacked under /usr2/web/myhost/ROOT,
 	tests OK

2.2) For TC 5.5.12 -> 5.5.17 :
Host parameters :
	unpackWARS=false
 	autodeploy=false
 	deployOnStartup=true
 	deployXML=false
 	appBase=/usr2/web/myhost	(for example)
Context Parameters :
 	path=""
 	docBase=/usr2/web/myhost/ROOT.war

OK for : 
 	ROOT.xml copied in $CATALINA_HOME/conf/[Engine]/myhost/, 
 	ROOT.war copied /usr2/web/myhost		(=Host.appBase)
 	ROOT.war unpacked under /usr2/web/myhost/ROOT, 	(even if my unpack parameter is false, but I prefer like this :)
BUT :
 	exceptions (stack traces) in tomcat logs when deploying !!!
	tests OK but I can't use getServletContext().getRealPath(...)

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: tomcat deployment changes since Tomcat 5.5.12

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: lionel.farbos@free.fr [mailto:lionel.farbos@free.fr] 
> Subject: Re: tomcat deployment changes since Tomcat 5.5.12
> 
> But the result is the same :
> - exceptions in Tomcat logs,
> - getServletContext().getRealPath(...) is null

There's no guarantee that getRealPath() will return anything useful,
although it usually does with an unpacked war.  Do you really need the
actual path?  Would getResourceAsStream() suffice?  Take a look at:
http://wiki.apache.org/tomcat/HowTo#head-45c3314139cb900ddd43dde2ff67153
2e6e844bc

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat deployment changes since Tomcat 5.5.12

Posted by li...@free.fr.
Thank you Chuck,

I tested (TC 5.5.17) what you suggest with a Context ROOT.xml like this :
<Context docBase="/usr2/web/myhost/ROOT.war" reloadable="false" debug="1">

But the result is the same :
- exceptions in Tomcat logs,
- getServletContext().getRealPath(...) is null


>> From: lionel.farbos@free.fr [mailto:lionel.farbos@free.fr] 
>> Subject: tomcat deployment changes since Tomcat 5.5.12
>> 
>> So, can anybody can say to me if it is a bug or what are the 
>> correct parameters for my needs ?
>
>Quoting from the Tomcat doc 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 [sic] from the filenames
>used for either the .xml context file or the docBase."
>
>Different versions of Tomcat 5.5 seem to react differently when the path
>parameter is present illegally.
>
> - Chuck


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: tomcat deployment changes since Tomcat 5.5.12

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: lionel.farbos@free.fr [mailto:lionel.farbos@free.fr] 
> Subject: tomcat deployment changes since Tomcat 5.5.12
> 
> So, can anybody can say to me if it is a bug or what are the 
> correct parameters for my needs ?

Quoting from the Tomcat doc 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 [sic] from the filenames
used for either the .xml context file or the docBase."

Different versions of Tomcat 5.5 seem to react differently when the path
parameter is present illegally.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org