Skip to content

@ConfigProperty injection in custom Validator #36125

Closed Answered by mkouba
gquintana asked this question in Q&A
Discussion options

You must be logged in to vote

The @ConfigProperty is injected at build time, not a initialization time

Well, not exactly at build time. The CDI container is started during the STATIC_INIT bootstrap phase. For a native executable build, however, the STATIC_INIT bootstrap phase runs as part of the native build process. I.e. if a CDI bean is initialized during STATIC_INIT of a native executable build then the @ConfigProperty injection points cannot reflect the runtime values (configured with system properteis and ENV variables). And it seems that ConstraintValidators are initialized during the STATIC_INIT phase.

Replies: 5 comments 16 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by gquintana
Comment options

You must be logged in to vote
3 replies
@mkouba
Comment options

mkouba Sep 25, 2023
Collaborator

@yrodiere
Comment options

@yrodiere
Comment options

Comment options

You must be logged in to vote
13 replies
@mkouba
Comment options

mkouba Sep 25, 2023
Collaborator

@yrodiere
Comment options

@gquintana
Comment options

@mkouba
Comment options

mkouba Sep 26, 2023
Collaborator

@yrodiere
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area/config area/arc Issue related to ARC (dependency injection)
3 participants