Bug 56938

Summary: Applications with uppercase context paths cannot be updated
Product: Tomcat 8 Reporter: Austin Jones <austinjones>
Component: ManagerAssignee: Tomcat Developers Mailing List <dev>
Severity: blocker CC: austinjones
Priority: P2    
Version: 8.0.12   
Target Milestone: ----   
Hardware: PC   
OS: Linux   

Description Austin Jones 2014-09-09 17:06:40 UTC
Tomcat 8.0.12 cannot update applications with uppercase context paths if the application is deployed as a compressed WAR file.

For the bug to occur, two deployments are required (let's call them v1 and v2).

Deployment v1 goes through fine.  Both the WAR and unpacked directory are updated.

Deployment v2 succeeds, but the application continues to serve v1.  The webapps WAR file is updated, but the unpacked app directory is not.

I traced the issue to HostConfig.java line 1226:

1225: String docBase = context.getDocBase();
1226:   docBase = docBase.toLowerCase(Locale.ENGLISH);
1227:   if (!docBase.endsWith(".war")) {
1234:     ExpandWar.delete(docBaseFile);
1237:   }
1238:   reload(app)

The lowercase context path is passed to ExpandWar.delete, so the unpacked dir is not deleted on case-sensitive filesystems.  Tomcat reports a successful deployment of v2 in the Manager interface.

The toLowerCase call should be moved into the if statement, or bound to a separate variable.  The original case-sensitive docBase path must be passed to ExpandWar.delete.
Comment 1 Mark Thomas 2014-09-12 16:10:33 UTC
Fixed in 8.0.x for 8.0.13 onwards and in 7.0.x for 7.0.56 onwards.
Comment 2 Austin Jones 2014-09-12 22:05:02 UTC
(In reply to Mark Thomas from comment #1)
> Fixed in 8.0.x for 8.0.13 onwards and in 7.0.x for 7.0.56 onwards.

Thank you, Mark!