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

@ConfigMapping throws java.util.NoSuchElementException #29583

Closed
floresmleonardo opened this issue Nov 30, 2022 · 1 comment · Fixed by #29653
Closed

@ConfigMapping throws java.util.NoSuchElementException #29583

floresmleonardo opened this issue Nov 30, 2022 · 1 comment · Fixed by #29653
Assignees
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@floresmleonardo
Copy link

floresmleonardo commented Nov 30, 2022

Describe the bug

Declaring a ConfigMapping in a quarkus extension runtime module as:

@ConfigMapping(prefix = "test")
public interface MyConfigMapping {

String id();

}

Then, using the quarkus extension deployment module to set it as Unremovable:

  @BuildStep
  UnremovableBeanBuildItem addUnremovable() {
    return UnremovableBeanBuildItem.beanTypes(MyConfigMapping.class);
  }

or:

 @BuildStep
  AdditionalBeanBuildItem addUnremovable() {
    return AdditionalBeanBuildItem.builder()
        .addBeanClass(MyConfigMapping.class)
        .setUnremovable()
        .build();
  }

throws:

java.util.NoSuchElementException: SRCFG00027: Could not find a mapping for org.test.MyConfigMapping

Expected behavior

It is expected the bean been marked as unremovable programmatically by the deployment module, be picked for the Configuration system

Output of uname -a or ver

Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000

Output of java -version

OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1

Quarkus version or git rev

2.14.2.Final

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

Gradle 7.5.1

Additional information

NOTE: Using the annotation @Unremovable directly on the ConfigMapping class works as expected.

@floresmleonardo floresmleonardo added the kind/bug Something isn't working label Nov 30, 2022
@geoand
Copy link
Contributor

geoand commented Dec 1, 2022

cc @radcortez

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants