[jboss-jira] [JBoss JIRA] (WFLY-11858) [Wildfly16] CDI fails to inject InitialContext during startup
Matej Novotny (Jira)
issues at jboss.org
Mon Mar 18 08:39:00 EDT 2019
[ https://issues.jboss.org/browse/WFLY-11858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13709608#comment-13709608 ]
Matej Novotny commented on WFLY-11858:
--------------------------------------
I know that it is supposed to be "caller sensitive" in a way that it operates a bean manager associated with whichever class invoked it (there is some underlying hierarchy of {{BeanManager}}s).
In WildFly there is [{{WeldProvider}}|https://github.com/wildfly/wildfly/blob/master/weld/subsystem/src/main/java/org/jboss/as/weld/WeldProvider.java] which implements this behaviour (how you obtain correct BM) which is then used by {{CDI.current()}}.
If you get "wrong" BM here, then you will not be able to see certain beans, even though they exist somewhere in the deployment.
The hierarchy of BMs is in place to enforce EE umbrella spec visibility limitations.
Maybe [~mkouba] would know more about {{CDI.current()}} in WFLY from the top of his head ;)
But from the exception we have seen here and from the fact that it sometimes fails and sometimes passes, I would rather guess that problem is in some service dependencies/startup order. The error is intermittent and if {{CDI.current()}} is the faulty bit, then _I think_ we would be seeing consistent failures instead.
> [Wildfly16] CDI fails to inject InitialContext during startup
> -------------------------------------------------------------
>
> Key: WFLY-11858
> URL: https://issues.jboss.org/browse/WFLY-11858
> Project: WildFly
> Issue Type: Bug
> Components: CDI / Weld, Transactions
> Affects Versions: 16.0.0.Final
> Reporter: Rakesh K. Cherukuri
> Assignee: Matej Novotny
> Priority: Major
> Attachments: stacktrace.log
>
>
> We are in the process of upgrading from 14.0.1.Final. While Wildfly 15.0.1 works fine, 16.0.0.Final is intermittently (3 out of 5 times) failing to start with following error
> _WELD-001334: Unsatisfied dependencies for type InitialContext with qualifiers_
> In our application, a bootstrap servlet startsup services (Stateless EJBs) during server startup. During this process the server fails to start with above error.
> Basically CDI is not able to find the appropriate InitialContext bean *intermittently*. This is not failing in our application code but in the wildfly libraries itself.
> Any pointers on this will be helpful. Don't want to end up with startup issues in stage/production :)
> Unfortunately my efforts to come up with a simplified maven module to showcase the error didn't succeed. So, please let me know if any further information is required and i will be glad to fill it in.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list