tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Maclean <stu...@apl.washington.edu>
Subject Bug in 5.5.9 ManagerServlet.deploy doing local file copy??
Date Wed, 14 Sep 2005 01:36:26 GMT
As a Tomcat user, I was trying to figure out deployment via the manager 
web app.  I was using Ant (1.6.5), and the 'config' attribute specifying 
the context .xml file.  I was under the impression that the config 
attribute described the .xml file as installed at Tomcat startup, e.g.

<target name="deploy.bad" description="Install UWME web application">
	<deploy url="${vhost}/manager"
		username="${user}"
		password="${pwd}"
		path="${uwme.path}"
	 
config="file:/usr/java/jakarta-tomcat-5.5.9/conf/Catalina/localhost/uwme.xml"
		update="false"/>

This kept failing, (version = 5.5.9, OS is RHEL3, VM is Sun's 1.4.2_03), 
and the .xml file kept getting truncated to 0 bytes???

Being an interested developer, I looked in the sources for class 
org.apache.catalina.manager.ManagerServlet, the servlet mapped to 
/manager/deploy.

At some point in deploy() it tries to do a copy from one file to another 
(aimed at directory copies??)  In my example, the src and destination 
file were resolving to the same file.  The 'copyInternal' routine does 
indeed truncate the file, I tested just that method with src and dest 
files of the same absolute path.

Of course, if I went back and changed the config attibute in the Ant 
task to some local context file, e.g. /tmp/uwme.xml, it all deployed fine.

Maybe the help pages for the manager web app should point out that you 
don't specify an in-place (conf/engine/host/) context .xml file, but one 
which will be copied into the in-place dir.

Hope this helps someone at least.

Stuart Maclean

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


Mime
View raw message