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

Bug Report: deployment fails with NPE when MPC value is only available profiled #6549

Closed
poikilotherm opened this issue Jan 31, 2024 · 0 comments · Fixed by #6550
Closed
Assignees
Labels
PR: CLA CLA submitted on PR by the contributor Type: Bug Label issue as a bug defect

Comments

@poikilotherm
Copy link
Contributor

Brief Summary

We use a MicroProfile Config lookup in a constructur. The setting is available from microprofile-config.properties, but only as a profiled setting: %ct.dataverse.siteUrl.

The deployment of Dataverse fails with an NPE because the resolver does not find a non-profiled value.

Expected Outcome

Just use the profiled value if no other value is present.

Current Outcome

Caused by: java.lang.NullPointerException: Cannot invoke "fish.payara.nucleus.microprofile.config.spi.ConfigValueImpl.getSourceOrdinal()" because "resultWithoutProfile" is null
 	at fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver.resolve(ConfigExpressionResolver.java:112)
 	at fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver.resolveExpression(ConfigExpressionResolver.java:227)
 	at fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver.resolveExpression(ConfigExpressionResolver.java:153)
 	at fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver.getValue(ConfigExpressionResolver.java:135)
 	at fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver.resolve(ConfigExpressionResolver.java:108)
 	at fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver.resolve(ConfigExpressionResolver.java:91)
 	at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.searchConfigSources(PayaraConfig.java:352)
	at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getConfigValue(PayaraConfig.java:251)
 	at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getConfigValue(PayaraConfig.java:229)
 	at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getValue(PayaraConfig.java:224)
 	at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getValueInternal(PayaraConfig.java:200)
 	at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getOptionalValue(PayaraConfig.java:173)

Reproducer

I will at least provide a PR with a unit test demonstrating the fail. I will try to provide a fix as well.

Operating System

Linux

JDK Version

Temurin 17.0.9

Payara Distribution

Payara Server Full Profile

@poikilotherm poikilotherm added Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Bug Label issue as a bug defect labels Jan 31, 2024
poikilotherm added a commit to poikilotherm/Payara that referenced this issue Jan 31, 2024
@Elifzeynepedman Elifzeynepedman added PR: CLA CLA submitted on PR by the contributor and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification labels Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: CLA CLA submitted on PR by the contributor Type: Bug Label issue as a bug defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants