Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start throws ConcurrentModificationException if an eeX-webapp.ini exists in start.d with a command line like: java -jar ../jetty-home/start.jar --module=server,http,ee8-webapp,ee8-deploy #11909

Closed
janbartel opened this issue Jun 12, 2024 · 2 comments · Fixed by #11913
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@janbartel
Copy link
Contributor

janbartel commented Jun 12, 2024

Jetty 12

Jetty Environment
Confirmed on ee8 and ee9, ee10 not tested

Given a pre-existing jetty-base of:

jetty-base/
├── etc
├── resources
└── start.d
|   ├── ee8-deploy.ini
|   |___ ee8-webapp.ini
|____ webapps

a command line like the following:

java -jar ../jetty-home/start.jar --module=server,http,ee8-webapp,ee8-deploy

results in:

java.util.ConcurrentModificationException
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1605)
at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1628)
at org.eclipse.jetty.start.Main.processCommandLine(Main.java:345)
at org.eclipse.jetty.start.Main.main(Main.java:74)

Usage: java -jar $JETTY_HOME/start.jar [options] [properties] [configs]
java -jar $JETTY_HOME/start.jar --help # for more information

Attached is the full output from running with startup debug logging enabled.
debug-out.txt

This issue was first reported in #11908, however the jetty maven plugin has no bearing on the problem, this is a problem with the start mechanism.

@janbartel janbartel added the Bug For general bugs on Jetty side label Jun 12, 2024
@joakime
Copy link
Contributor

joakime commented Jun 12, 2024

This issue was first reported in #11908, however the jetty maven plugin has no bearing on the problem, this is a problem with the start mechanism.

That is surprising indeed!

@joakime
Copy link
Contributor

joakime commented Jun 12, 2024

Smaller reproduction case ...

[joakim@hyperion ee-exception]$ tree -F
./
├── resources/
│   └── jetty-logging.properties
├── start.d/
│   ├── ee9-deploy.ini
│   └── ee9-webapp.ini
└── webapps/

3 directories, 3 files

[joakim@hyperion ee-exception]$ find . -type f -print -exec cat {} \;
./start.d/ee9-webapp.ini
--modules=ee9-webapp

./start.d/ee9-deploy.ini
--modules=ee9-deploy

./resources/jetty-logging.properties
org.eclipse.jetty.LEVEL=INFO

[joakim@hyperion ee-exception]$ java -jar ../../jetty-home-12.0.7/start.jar --module=server,http,ee9-webapp
java.util.ConcurrentModificationException
	at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1605)
	at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1628)
	at org.eclipse.jetty.start.Main.processCommandLine(Main.java:345)
	at org.eclipse.jetty.start.Main.main(Main.java:74)

Usage: java -jar $JETTY_HOME/start.jar [options] [properties] [configs]
       java -jar $JETTY_HOME/start.jar --help  # for more information

It's the ee9-webapp module specifically doing it.
Oddly I cannot reproduce on ee8-webapp or ee10-webapp

It's in bad form to have the module enabled twice, but that should just result in an ignored re-enablement, not a ConcurrentModificationException.

joakime added a commit that referenced this issue Jun 12, 2024
…icationException

+ Reworked tracking of enabled modules to not
  trigger change in "sources" Set if the module
  is already enabled.
joakime added a commit that referenced this issue Jun 13, 2024
…exception

Issue #11909 - duplicate --modules=<name> can trigger ConcurrentModificationException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
2 participants