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

Microprofile config implementation only loads one properties file #4049

Closed
edthorne opened this issue Jun 14, 2019 · 1 comment · Fixed by #4050
Closed

Microprofile config implementation only loads one properties file #4049

edthorne opened this issue Jun 14, 2019 · 1 comment · Fixed by #4050

Comments

@edthorne
Copy link
Contributor

Description

Looking at the implementation of ConfigProviderResolverImpl.initialiseApplicationConfig(...) and it's change history I believe it was broken with commit 99370d7.

Expected Outcome

The microprofile configuration spec for default ConfigSources indicates that all META-INF/microprofile-config.properties files on the classpath should be loaded.

A ConfigSource for each property file META-INF/microprofile-config.properties found on the classpath. (default ordinal = 100).

Current Outcome

The configuration provider loads only the first properties file returned by the classloader. This results in default configuration values in any other files not being loaded into the config.

Steps to reproduce

I experienced this bug during test execution in my project. I've been using Arquillian to test features and injecting a config file into the test deployment with defaults for the test case.

When I recently started exploring usage of the MP REST client, I added another config file to the project in the source classpath for default locations of the services. Adding this config hides the configuration included in the test deployment and causes the tests to fail because the values used by the test are no longer present in the configuration.

While Arquillian should only be using the config file inside the deployment during testing, I suspect that using the embedded Payara container has the source/test classpath available and the MP config is picking up both.

Environment

  • Payara Version: 5.192
  • Edition: Micro
  • JDK Version: OpenJDK 8
  • Operating System: Linux
@edthorne
Copy link
Contributor Author

I'll have a PR pushed shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants