-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty start.jar fails with NullPointerException when referencing a non existent module and using JVM args #8222
Comments
Correct, the module The standard Servlet AsyncContext is the replacement. This still shouldn't result in a NPE, that's quite surprising. (will attempt to replicate) |
Cannot replicate
then attempt to run ...
As expected, invalidate module entries (ones that don't exist) are ignored. |
Lets try a few things (in order) First, ensure you are following the recommendations and are using a split Next, run Finally, if that fails with an NPE, run with |
Hmm, strange. The problem disappeared after we removed that module from our |
OK what I did to reproduce:
|
The Once you unpack it, it should be treated as read-only. The To properly setup that your example in a similar and proper way. [joakim@hyperion bases]$ mkdir example-continuations-base
[joakim@hyperion bases]$ cd example-continuations-base/
[joakim@hyperion example-continuations-base]$ java -jar ../../jetty-home-10.0.11/start.jar --add-modules=http,deploy,jvm
INFO : mkdir ${jetty.base}/start.d
INFO : webapp transitively enabled, ini template available with --add-module=webapp
INFO : jvm initialized in ${jetty.base}/start.d/jvm.ini
INFO : server transitively enabled, ini template available with --add-module=server
INFO : logging-jetty transitively enabled
INFO : security transitively enabled
INFO : servlet transitively enabled
INFO : http initialized in ${jetty.base}/start.d/http.ini
INFO : resources transitively enabled
INFO : threadpool transitively enabled, ini template available with --add-module=threadpool
INFO : logging/slf4j transitive provider of logging/slf4j for logging-jetty
INFO : logging/slf4j dynamic dependency of logging-jetty
INFO : bytebufferpool transitively enabled, ini template available with --add-module=bytebufferpool
INFO : deploy initialized in ${jetty.base}/start.d/deploy.ini
INFO : mkdir ${jetty.base}/resources
INFO : copy ${jetty.home}/modules/logging/jetty/resources/jetty-logging.properties to ${jetty.base}/resources/jetty-logging.properties
INFO : mkdir ${jetty.base}/webapps
INFO : Base directory was modified
[joakim@hyperion example-continuations-base]$ tree
.
├── resources
│ └── jetty-logging.properties
├── start.d
│ ├── deploy.ini
│ ├── http.ini
│ └── jvm.ini
└── webapps
3 directories, 4 files
[joakim@hyperion example-continuations-base]$ echo "--module=continuation" >> start.d/continuation.ini
[joakim@hyperion example-continuations-base]$ echo "--exec" >> start.d/jvm.ini
[joakim@hyperion example-continuations-base]$ echo "-Xmx1g" >> start.d/jvm.ini You can then look at the configuration ...
Now THIS configuration triggers the NPE.
Investigating... |
The NPE is from the combination of The configuration is fine, StartArgs is fine, the modules (discovered and enabled) is fine. |
Signed-off-by: Joakim Erdfelt <[email protected]>
+ Better variable naming. Signed-off-by: Joakim Erdfelt <[email protected]>
Opened PR #8223 |
+ Simpler use case, without need for new StartArgs method Signed-off-by: Joakim Erdfelt <[email protected]>
+ Correct naming in StartArgs.getEnabledModules + Introduce StartArgs.getSelectedModules + Change javadoc and usage everywhere else Signed-off-by: Joakim Erdfelt <[email protected]>
…8223) * Issue #8222 - Addressing NPE with JvmArgs and non-existent modules. + Better variable naming. + Simpler use case, without need for new StartArgs method + Correct naming in StartArgs.getEnabledModules + Introduce StartArgs.getSelectedModules + Change javadoc and usage everywhere else * Stabilize flaky test by using UTC properly Signed-off-by: Joakim Erdfelt <[email protected]>
Jetty version(s) 10.0.11
Java version/vendor
openjdk 11.0.15+10
Description
Running webapp with Jetty distribution fails with a null pointer exception:
We are upgrading from Jetty
9.4.45.v20220203
and reusing the same.ini
files. It seems thatcontinuation
module has been removed.Reference: https://github.com/eclipse/jetty.project/blob/jetty-10.0.x/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java#L474:L476
My suspicion is that line 474 returns null because module is not found. It would be nice to throw an Exception when module is not found to help figuring out the problem.
How to reproduce?
start.ini
:java -jar /jetty/start.jar
The text was updated successfully, but these errors were encountered: