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

Configuration validation failed error when mixing @ConfigMapping and @ConfigProperty #44011

Closed
elenagarrido opened this issue Oct 22, 2024 · 3 comments
Labels
area/config kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.

Comments

@elenagarrido
Copy link

Describe the bug

We have an interface declared as follows

@ConfigMapping(prefix = "aaa.ldap.pool")
public interface ConnectionPoolConfig {
.... several methods matching with the configuration values
}

in a class we have

@ApplicationScoped
public class LogsSummarizer {
  @ConfigProperty(name = "aaa.rlogsummary.period")
  String secondsPreiod;
}

In our application.yaml file

aaa:
  ldap:
    pool:
        ..... names matching with the interface
  logsummary:
    period: 30s

Expected behavior

To run the application and be able to retrieve the values from the interface and the class

Actual behavior

We have an exception
Caused by: io.smallrye.config.ConfigValidationException: Configuration validation failed:
SRCFG00050: aaa.logsummary.period in YamlConfigSource[source=file:/C:/..../target/classes/application.yaml] does not map to any root

As soon as I change the name of the variable in the class to
aaalogsummary.period

and the respective yaml file to

aaa:
 ldap:
   pool:
       ..... names matching with the interface
aaalogsummary:
   period: 30s

I stop having the exception and the application runs. But I would prefer to have the application.yaml file the way it fails right now

How to Reproduce?

No response

Output of uname -a or ver

inux currito 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

Java version: 17.0.5, vendor: N/A, runtime: /usr/lib64/jvm/java-17-openjdk-17

Quarkus version or git rev

3.9.5

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

Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)

Additional information

No response

@elenagarrido elenagarrido added the kind/bug Something isn't working label Oct 22, 2024
Copy link

quarkus-bot bot commented Oct 22, 2024

/cc @radcortez (config)

@radcortez
Copy link
Member

I couldn't reproduce the issue with the description: radcortez/quarkus-config-playground@de502f7

Can you please provide me with your reproducer that shows the problem? Or fix mine? Thanks!

@radcortez radcortez added the triage/needs-reproducer We are waiting for a reproducer. label Oct 22, 2024
@radcortez
Copy link
Member

Closing this because we didn't get a reproducer. Feel free to reopen if the issue persists and if you can provide us with a reproducer. Thank you!

@radcortez radcortez closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
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