[jboss-jira] [JBoss JIRA] (WFLY-11817) CDI @Resource(lookup=...) processing does not start corresponding binding service
Paul Ferraro (Jira)
issues at jboss.org
Thu Mar 7 08:13:01 EST 2019
[ https://issues.jboss.org/browse/WFLY-11817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13704971#comment-13704971 ]
Paul Ferraro commented on WFLY-11817:
-------------------------------------
[~manovotn] A simple modification to this test will reproduce the problem:
https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ee/injection/resource/infinispan/InfinispanInjectionTestCase.java
Adding a CDI annotation anywhere within: https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ee/injection/resource/infinispan/InfinispanManagedBean.java
will cause CDI to resolve the @Resource annotations instead of the ee subsystem. This causes the test to fail with an NPE.
For reference, the deployment processor for @Resource annotations in the ee subsystem is here:
https://github.com/wildfly/wildfly/blob/master/ee/src/main/java/org/jboss/as/ee/component/deployers/ResourceInjectionAnnotationParsingProcessor.java
specifically, the resolution for @Resource(lookup="...") is handled by:
https://github.com/wildfly/wildfly/blob/master/ee/src/main/java/org/jboss/as/ee/component/LookupInjectionSource.java
The binding service to which I was referring (as used by LookupInjectionSource) is here:
https://github.com/wildfly/wildfly/blob/master/naming/src/main/java/org/jboss/as/naming/service/BinderService.java
> CDI @Resource(lookup=...) processing does not start corresponding binding service
> ---------------------------------------------------------------------------------
>
> Key: WFLY-11817
> URL: https://issues.jboss.org/browse/WFLY-11817
> Project: WildFly
> Issue Type: Bug
> Components: CDI / Weld
> Affects Versions: 16.0.0.Final
> Reporter: Paul Ferraro
> Assignee: Matej Novotny
> Priority: Major
>
> If the corresponding binding service (the service responsible for creating the jndi binding) is not ACTIVE (e.g. clustering binding services are always PASSIVE) or, due to a race condition, has not yet started completely, a null value will be returned.
> The ee subsystem processes @Resource(lookup=...) correctly by establishing a dependency on the corresponding binder service.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list