2014-03-16 0:14 GMT+04:00 Konstantin Kolinko <knst.koli...@gmail.com>:
> 2014-03-13 19:30 GMT+04:00  <ma...@apache.org>:
>> Author: markt
>> Date: Thu Mar 13 15:30:35 2014
>> New Revision: 1577199
>>
>> URL: http://svn.apache.org/r1577199
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56248
>> Allow the deployer to update an existing WAR file without
>> undeploying the existing application if the update flag is set.
>> This allows any existing custom context.xml for the application
>> to be retained. To update an application and remove any existing
>> context.xml simply undeploy the old version of the application
>> before deploying the new version.
>>
>> Modified:
>>     tomcat/tc7.0.x/trunk/   (props changed)
>>     
>> tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
>>     tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
>>     tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java
>>     tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>>
>> Propchange: tomcat/tc7.0.x/trunk/
>> ------------------------------------------------------------------------------
>>   Merged /tomcat/trunk:r1577182,1577195
>>
>
> There is a bug in this commit in the second deploy() method,
>
>     protected void deploy(PrintWriter writer, ContextName cn, String tag,
>             StringManager smClient) {
> .. lines 740
>
>         // Find the local WAR file
>         File localWar = new File(versioned, baseName + ".war");
>
> The filename of a tagged war file should be  versioned + tag +
> baseName.war.  The "tag" part was lost.

2. ..line 744

        File deployedWar = new File(host.getAppBase(), baseName + ".war");

The value of "host.getAppBase()" is not guaranteed to be an absolute path.

In TC7 here there is field  ManagerServlet.deployed that provides
absolute value of that path.
There is also method ManagerServlet.getAppBase() that provides
canonical path for it.

The TC8 code is correct here. It calls a different method on a Host.
 new File(host.getAppBaseFile(), baseName + ".war");


The first and third deploy() methods are OK, no issues noted there.

Best regards,
Konstantin Kolinko

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

Reply via email to