Skip to content

Show nicer error when a @ConfigMapping class exists in the deployment module and set to the runtime phase #43394

Open

Description

Description

While creating (see this PR for more context - quarkusio/quarkus-workshops#600), I noticed that the following error is thrown when the @ConfigMapping phase is set to RUN_TIME:

Caused by: java.lang.ClassNotFoundException: io.quarkus.workshop.superheroes.version.deployment.VersionConfig
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:533)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:481)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:533)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:481)
	at io.quarkus.runtime.configuration.AbstractConfigBuilder.withMapping(AbstractConfigBuilder.java:64)
	... 21 more

The solution was to move the @ConfigMapping to the runtime module, but the error message is a bit cryptic.

Implementation ideas

It would be nice if we could detect that somehow and display a nicer error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions