jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more

Home Page:https://eclipse.dev/jetty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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`

janbartel opened this issue · comments

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.

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!

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.