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

Usage of quarkus.config.locations results in ClassNotFoundException #30280

Closed
benjaminrau opened this issue Jan 10, 2023 · 2 comments
Closed
Labels
area/config kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.

Comments

@benjaminrau
Copy link

benjaminrau commented Jan 10, 2023

Describe the bug

I added quarkus.config.locations: application.common.yaml to my application.yaml (i used the yaml config source extension) which results in an java.lang.NoClassDefFoundError: org/apache/commons/io/FilenameUtils on io.quarkus.deployment.steps.ConfigGenerationBuildStep#appendProfileToFilename.

The error is gone as soon as i add commons-io as / maven dependency myself.

Expected behavior

Since that seems to be a core configuration option i expect that the commons-io dependency has to be resolved on quarkus core itself.

Actual behavior

An exception is thrown on application startup until you add the dependency yourself.

How to Reproduce?

Reproducer:

  1. Create a clean project
  2. Use quarkus.config.locations: application.common.properties`
  3. Start the application

Output of uname -a or ver

Linux br-builders-nb 5.14.0-1052-oem #59-Ubuntu SMP Fri Jan 10 09:37:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17" 2022-01-10 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.15.2.Final

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

No response

Additional information

2023-01-10 12:45:39,154 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2023-01-10 12:45:39,504 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.deployment.steps.ConfigGenerationBuildStep#watchConfigFiles threw an exception: java.lang.NoClassDefFoundError: org/apache/commons/io/FilenameUtils
	at io.quarkus.deployment.steps.ConfigGenerationBuildStep.appendProfileToFilename(ConfigGenerationBuildStep.java:358)
	at io.quarkus.deployment.steps.ConfigGenerationBuildStep.lambda$watchConfigFiles$0(ConfigGenerationBuildStep.java:339)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at io.quarkus.deployment.steps.ConfigGenerationBuildStep.watchConfigFiles(ConfigGenerationBuildStep.java:333)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at java.base/java.lang.Thread.run(Thread.java:833)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FilenameUtils
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
@benjaminrau benjaminrau added the kind/bug Something isn't working label Jan 10, 2023
@geoand
Copy link
Contributor

geoand commented Jan 10, 2023

I was not able to reproduce this... Can you attach a sample project that exhibits this behavior please?

@geoand geoand added the triage/needs-reproducer We are waiting for a reproducer. label Jan 10, 2023
@benjaminrau
Copy link
Author

benjaminrau commented Jan 11, 2023

I am not able to reproduce the issue on a fresh repo either - seems to be related to something on my installation. Sorry for wasting your time, i was sure i foreclosed all local issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.
Projects
None yet
Development

No branches or pull requests

2 participants