-
Notifications
You must be signed in to change notification settings - Fork 77
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
How can getReference() legally be invoked during AfterDeploymentValidation event if contexts have not been created yet? #454
Comments
Well, the fact that the However, I think that the wording in section 11.3. could be relaxed a bit - I don't think the "before creating contex" part makes sense. |
So, the bean validation actually happens before your You can take a look at how Weld does it here - it shows the flow I just described.
I agree it's not overly useful, but it is probably the only point which implies the earliest point at which contexts can be created? |
I agree. If I remember my history right, there was a time when |
Well that's still there (11.3.), spec says that if you call |
No, I know that, I meant at some point in the long-ago past I seem to recall you couldn't even call it at |
Oh, I see. |
Ah; may have found it: https://issues.redhat.com/browse/CDI-392 |
Not quite the right issue but in the general vicinity. Too lazy to dig further. 😄 |
This issue is long overdue but still valid for CDI 4.0 - https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#after_deployment_validation |
Section 11.5.4 says:
Section 11.3 indicates that it is legal to call
BeanManager#getReference(Bean, Type, CreationalContext)
in anAfterDeploymentValidation
observer method.In order to get contextual references, such as those returned by
getReference()
, you need a context.Is this a bug in the specification? Does section 11.5.4 need to be amended in some way?
The text was updated successfully, but these errors were encountered: