question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Smallrye ConfigSourceFactory not loading class

See original GitHub issue

Describe the bug

When using a ConfigSourceFactory the class is not loaded and the build (both maven and gradle) fails with:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.737 s
[INFO] Finished at: 2021-11-25T11:24:15-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.5.0.Final:generate-code (default) on project bidder: Quarkus code generation phase has failed: InvocationTargetException: io.smallrye.config.ConfigSourceFactory: Provider com.adquick.service.athena.ConsumerConfig not found -> [Help 1]

Goals tested: quarkus:dev, compile, package. The class referenced in the src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceFactory file is being loaded before its compilation. Works when using Quarkus 1.13.4.

Expected behavior

The config factory should be loaded and executed.

Actual behavior

Buidl failes with:

Caused by: java.util.ServiceConfigurationError: io.smallrye.config.ConfigSourceFactory: Provider com.adquick.service.athena.ConsumerConfig not found
    at java.util.ServiceLoader.fail (ServiceLoader.java:593)
    at java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass (ServiceLoader.java:1219)
    at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService (ServiceLoader.java:1228)
    at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext (ServiceLoader.java:1273)
    at java.util.ServiceLoader$2.hasNext (ServiceLoader.java:1309)
    at java.util.ServiceLoader$3.hasNext (ServiceLoader.java:1393)

How to Reproduce?

Run quarkus:dev to reproduce:

./mvnw clean compile quarkus:dev

A “workaround”:

  1. Comment the class in:
src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceFactory
  1. Run ./mvnw compile

  2. Uncomment the class

  3. Run:

./mvnw quarkus:dev

bidder-maven.zip

Output of uname -a or ver

Darwin Andre-MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Output of java -version

openjdk version “17.0.1” 2021-10-19 OpenJDK Runtime Environment GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.5.0.Final

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

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andrerigoncommented, Nov 25, 2021

Yes, but then the code doesn’t compile - we use quarkus-avro.

0reactions
michalszynkiewiczcommented, Nov 30, 2021

@radcortez if I understand the quesiton correctly, then the answer is yes. Having properties from application.properties/yaml should be enough for code gen IMO

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending Configuration Support - Quarkus
io.smallrye.config.ConfigSourceFactory priority does not affect the ConfigSource ordinal. These are sorted independently. When the Factory is initializing ...
Read more >
Custom - SmallRye Config
The io.smallrye.config.ConfigSourceFactory priority does not affect the ConfigSource ordinal. These are sorted independently. When the Factory is initializing, ...
Read more >
Custom MicroProfile Configuration Sources in Quarkus
For this, we place a file with the name io.smallrye.config.ConfigSourceFactory into the directory META-INF/services/ , which contains the full ...
Read more >
How to create a ConfigSource for Quarkus that knows about ...
Luckily this happens via the Java ServiceLoader interface. A file called io.smallrye.config.ConfigSourceFactory is put into META-INF/services/ ...
Read more >
io.smallrye.config.SmallRyeConfigBuilder Maven / Gradle / Ivy
The class is part of the package ➦ Group: io.smallrye.config ➦ Artifact: ... configSourceFactoryLoader = ServiceLoader.load(ConfigSourceFactory.class, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found