-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
@ConfigProperty
not working in ContextResolver
#4020
Comments
@abelsromero If you want this injection to work before |
@gwenneg any idea why it doesn't work in previous versions? |
@geoand It looks like there's a I'm not sure of the best way to force the |
@geoand I've been looking for an existing |
@gwenneg interesting. I haden't seen |
@geoand I don't remember the details but it was something like that we don't register all providers found on the class path. See #1924 comments for more details. @gwenneg So your solution is ok for |
In case someone comes here looking for the TLDR. |
Thanks for your feedback @abelsromero! |
Describe the bug
Properties marked for configuration injection with
@ConfigProperty
in aContextResolver
are null unless class is annotated with@ApplicationScoped
.Expected behavior
Property should have the value defined in
application.properties
without additional configuration.Actual behavior
Property value is
null
unless class is annotated with@ApplicationScoped
.To Reproduce
Steps to reproduce the behavior:
json.date-format=yyyy-MM-dd'T'HH:mm:ss.SSSX
toapplication properties
.@ApplicationScoped
to class and repeat to see the value is not null.Configuration
N/A
Screenshots
N/A
Environment (please complete the following information):
Quarkus version: 0.21.2
Extensions: [agroal, cdi, hibernate-orm, hibernate-validator, jdbc-postgresql, narayana-jta, resteasy, resteasy-jsonb, security, smallrye-jwt]
Maven home: /home/asalgadr/.sdkman/candidates/maven/current
Java version: 1.8.0_222, vendor: Oracle Corporation, runtime: /home/asalgadr/.sdkman/candidates/java/19.2.0-grl/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.1.21-1-manjaro", arch: "amd64", family: "unix"
Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: