Skip to content

Quarkus reports a NoSuchMethod hiding the real cause when it fails to start #45676

@ia3andy

Description

@ia3andy

Describe the bug

Quarkus reports a NoSuchMethod hiding the real cause when it fails to start.

2025-01-17 10:05:30,287 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to recover after failed start: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: java.util.OptionalInt.<init>()
	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.startServerAfterFailedStart(VertxHttpRecorder.java:308)
	at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup.handleFailedInitialStart(VertxHttpHotReplacementSetup.java:73)
	at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.startupFailed(RuntimeUpdatesProcessor.java:1299)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:126)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:428)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:55)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:138)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:93)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: java.util.OptionalInt.<init>()
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleObject(ConfigInstantiator.java:139)
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleObject(ConfigInstantiator.java:78)
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleObject(ConfigInstantiator.java:57)
	at io.quarkus.vertx.http.runtime.VertxHttpRecorder.startServerAfterFailedStart(VertxHttpRecorder.java:277)
	... 9 more
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: java.util.OptionalInt.<init>()
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleObject(ConfigInstantiator.java:139)
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleMap(ConfigInstantiator.java:178)
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleObject(ConfigInstantiator.java:121)
	... 12 more
Caused by: java.lang.NoSuchMethodException: java.util.OptionalInt.<init>()
	at java.base/java.lang.Class.getConstructor0(Class.java:3833)
	at java.base/java.lang.Class.getConstructor(Class.java:2501)
	at io.quarkus.runtime.configuration.ConfigInstantiator.handleObject(ConfigInstantiator.java:106)
	... 14 more

This only happens when using this in the config:

%dev.quarkus.http.static-resources.caching-enabled=false
%dev.quarkus.http.filter.static.header."Cache-Control"=no-cache
%dev.quarkus.http.filter.static.matches=/static/bundle/.+
%dev.quarkus.http.filter.static.methods=GET

I am not sure why it doesn't happen when there is no initial error.

It is causes by:
https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/FilterConfig.java#L37
(public java.util.OptionalInt io.quarkus.vertx.http.runtime.FilterConfig.order)

Expected behavior

Should show the real issue

Actual behavior

Show the wrong issue

How to Reproduce?

quarkus dev on:
https://github.com/ia3andy/reproducer-nsm.git

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.17.7

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions