Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-22290

[GSS](7.4.z) WFLY-11817 - CDI @Resource(lookup=...) processing does not start corresponding binder service

XMLWordPrintable

    • +
    • Workaround Exists
    • Hide

      Use a <resource-ref/> which references a <lookup-name/> via a <res-ref-name/> , and use @Resource(name = "...") instead.

      Show
      Use a <resource-ref/> which references a <lookup-name/> via a <res-ref-name/> , and use @Resource(name = "...") instead.

      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 is newly problematic for EAP 7.4, where the Infinispan APIs are public.
      Thus, users attempting to inject, for example, a server managed cache into a CDI bean will fail during runtime.
      e.g.

      @Resource(lookup="java:jboss/infinispan/cache/foo/bar")
      private Cache<?, ?> cache;
      

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: