Interesting issue while deploying an angular application (Tomcat 10.1.x)
"Amit Pande via users" <[email protected]> Tue, 23 Jun 2026 19:48:39 +0000
| Newsgroups | gmane.comp.jakarta.tomcat.user |
|---|---|
| Message-ID | <MW5PR14MB54364D6EDB768C83AEEA6326E2EE2@MW5PR14MB5436.namprd14.prod.outlook.com> |
--_000_MW5PR14MB54364D6EDB768C83AEEA6326E2EE2MW5PR14MB5436namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable We have an angular based web application with a bunch of static resources. The war is present under the "webapps" app base. Understandably it is NOT right way (and fixed in later deployments), but th= e server.xml has: <Context path=3D"/ui"> ... </Context> This caused an issue while deploying and accessing this application on a Wi= ndows 2019 setup. I don't have full access to this environment and hence could not do more de= bugging than necessary. Gemini AI gave a below possible explanation to this very rare problem (ther= e were multiple identical setups and none of them seen any issue). This <Context> tag sits inside a <Host> container where appBase=3D"webapps"= and it causes Tomcat to get into a race condition: Auto-Deployer: Tomcat scans the webapps folder, sees a folder named ui, and= deploys it automatically as a standard web app. Explicit Deployer: Tomcat reads server.xml, sees your <Context path=3D"/ui"= > block, and tries to deploy a second application mapped to /ui using an ab= solute path reference. Because of this conflict, Tomcat splits the application in memory. The init= ial mapping (which handles the 302 redirect) belongs to one deployment inst= ance, but when it goes to fetch index.html or test.txt, it looks at the exp= licit server.xml context instance. Potential cause of this: Due to differences in disk speed, CPU core scheduling, or security file-loc= king delays (like an EDR agent scanning the files on boot), the server.xml = parser registers the context first. This breaks the link to the physical we= bapps directory, causing the files to become invisible to the web server. Does this explanation seem reasonable? FWIW, the setup has 20 CPUs and also has Trellix Endpoint Security software= . Appreciate any insights into this very odd issue. We fixed it by removing the Context element from server.xml. Thanks, Amit --_000_MW5PR14MB54364D6EDB768C83AEEA6326E2EE2MW5PR14MB5436namp_--