Bug 56938 - Applications with uppercase context paths cannot be updated
Summary: Applications with uppercase context paths cannot be updated
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Manager (show other bugs)
Version: 8.0.12
Hardware: PC Linux
: P2 blocker (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-09 17:06 UTC by Austin Jones
Modified: 2014-09-12 22:05 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!