1 Reply Latest reply on May 22, 2007 3:10 PM by brian.stansberry

    @Resource injection from HA-JNDI

    relgames

      Hello!

      We have Jboss 4.0.5 GA with ejb3-clustered and HA-JMS.
      When we run 2 nodes, first node works ok, but second don't see Queues from HA-JNDI.

      Queues are injected into beans using @Resource annotation, and when this bean is running on the same node with master HA-JNDI, all ok.
      But it can't inject Queue on the second node.

      When we try to use InitialContext with jnp.provider.url configured, all works fine - HA-JNDI is used.

      But how to enable HA-JNDI lookup for @Resource annotation?

        • 1. Re: @Resource injection from HA-JNDI
          brian.stansberry

          I've been following the code to see how this is meant to work, and here's what I see:

          1) @Resource injections are resolved relative to the component ENC.
          2) Component ENC is created relative to a default InitialContext (i.e. non-HA JNDI) unless a set of JNDI properties are provided via the deployment. If they are provided, the InitialContext uses those properties.
          3) Those properties come via a call to interface org.jboss.ejb3.DeploymentUnit.getJndiProperties().

          and now the sad part...

          4) The JBoss 4.x impl of DeploymentUnit just returns null from getJndiProperties(), as do 2 out of the 3 impls in the AS 5 codebase. :(

          Suggest you search the EJB3 JIRA to see if there is any existing issue related to getting this implemented. If not, open a forum thread on the EJB3 forum to help drive getting a JIRA opened for it.