3 Replies Latest reply on Jan 30, 2006 11:53 AM by chetanagg

    Remote Resources in EJB java:comp/env/ ?

    ju

      Hi

      I wanted to know if it is possible to access to remote resources from inside an EJB without pre-loading them in the HAJndi (if I've understood well how it works).
      I'm actually deploying my application on a jboss cluster (2 nodes for the moment). With one EJB on one node, I'm trying to access to a queue on the other node. I'm trying to use the ENC (entreprise naming context) to do it but when I do my lookup (ctx.lookup("java:comp/env/queue/RssItems")) a NameNotFoundException is raised whereas when I do a global lookup (ctx.lookup("queue/RssItems")) it simply works.

      The same thing happens when I'm trying to call a remote service in the same way.

      However, it seems to work perfectly when I make first a global lookup and then a ENC lookup.
      Is this because the HAJNDI doesn't link the different references automatically when the ENC is called ? or have I done something wrong?


      I'm using jboss-4.0.3SP1 on j2sdk1.4.2 on Win2k

      Thanks
      ju

        • 1. Re: Remote Resources in EJB java:comp/env/ ?
          ju

          Oops, I've mistaken.
          It doesn't even work when we do a global lookup and then a ENC lookup...

          • 2. Re: Remote Resources in EJB java:comp/env/ ?
            brian.stansberry

            The ENC context is mapped to local JNDI, so you can't find resources that aren't bound on the local server. You need to configure your InitialContext to use the HA-JNDI service and look up "queue/RssItems".

            Note that this doesn't mean "queue/RssItems" has to be bound in the HA-JNDI tree; normally it wouldn't be. The HA-JNDI service can search the local JNDI trees on all server nodes to find a binding.

            • 3. Re: Remote Resources in EJB java:comp/env/ ?
              chetanagg

              Hi,

              If we bind the queue to local JNDI server , i am able to lookup through HA JNDI . But does it mean that it is HA Queue. Means Queue is clustered queue.

              Also i have made a MBean dependent on HA Queue, but it seems its not able to find queue in HA JNDI. MBean always fails with Queue NOTYETINSTANTIATED.

              Please suggest.

              Thanks and Regards,
              Chetan