jetty / jetty/jetty.project

Jetty 12.1.4 not correctly redeploying changed war (after trying to redeploy)

Open
#14,136 3 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Java
Stars
4.1k
Forks
2k
Avg merge
3d 56m
Merged PRs (30d)
48

Description

**Jetty version(s)**

12.1.4

**Jetty Environment**

ee10

**HTTP version**

NA

**Java version/vendor** `(use: java -version)`

java version "25.0.1" 2025-10-21 LTS
Java(TM) SE Runtime Environment (build 25.0.1+8-LTS-27)
Java HotSpot(TM) 64-Bit Server VM (build 25.0.1+8-LTS-27, mixed mode, sharing)

**OS type/version**

Linux Ubuntu 24.04

**Description**

When you have a scanInterval configured Jetty will detect a changed war file and redeploy, confirmed by the log file and seeing that there is a new tmp directory for the war. However, the actual served war did not change. After investigation, although the redeployment deleted the old tmp war directory and created a new one, the *contents* of the new tmp war file directory did not change. You can verify by expanding the war file that it claims to be using yourself and compare that the tmp war directory does *not* have the new contents.

I enabled debug output in Jetty and think that the issue is with FileSystemPool caching. On initially loading "ROOT.war" you can see in the debug log:

jetty-1 | 2025-12-04 18:38:52.915:DEBUG:oejur.FileSystemPool:main: Mounted new FS jar:file:///opt/jetty/webapps/ROOT.war!/
jetty-1 | 2025-12-04 18:38:52.916:DEBUG:oejur.FileSystemPool:main: Pooling new FS /opt/jetty/webapps/ROOT.war
jetty-1 | 2025-12-04 18:38:52.916:DEBUG:oeje10w.WebInfConfiguration:main: Copy jar:file:///opt/jetty/webapps/ROOT.war!/ to /opt/jetty/work/jetty-0_0_0_0-8080-ROOT_war-_-any-/webapp

After you replace the "ROOT.war" and Jetty is doing the redoplyment, which is supposed to be using the new "ROOT.war", you can see in the debug log:

jetty-1 | 2025-12-04 18:40:23.910:DEBUG:oejur.FileSystemPool:Scanner-0-1: Using existing FS jar:file:///opt/jetty/webapps/ROOT.war!/
jetty-1 | 2025-12-04 18:40:23.911:DEBUG:oejur.FileSystemPool:Scanner-0-1: Incremented ref counter to 2 for FS /opt/jetty/webapps/ROOT.war
jetty-1 | 2025-12-04 18:40:23.911:DEBUG:oeje10w.WebInfConfiguration:Scanner-0-1: Copy jar:file:///opt/jetty/webapps/ROOT.war!/ to /opt/jetty/work/jetty-0_0_0_0-8080-ROOT_war-_-any-/webapp

This is clearly wrong. It should not be using the same FS that it opened for the previous version of "ROOT.war". I think that the issue is that the first use failed to close the FS to get it out of the FS pool.

**How to reproduce?**

Ensure that you have the ee10-deploy module enabled and set the scanInterval in deployment-scanner.ini. Put a
"ROOT.war" in the webapps directory and start Jetty. Jetty should now be serving the contents of the "ROOT.war". Now replace the "ROOT.war" with a new one and wait for the scan to detect the change and redeploy. After the logs say that it has redeployed, notice that the "ROOT.war" being served did not actually change.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.