4 Replies Latest reply on Sep 21, 2005 4:00 PM by Jerry Gauthier

    Inconsistent JNDI Lookup

    Greg Paul Newbie

      I have a 4.0.2 cluster with 2 nodes running on java 1.4.2_05 on solaris 5.7. Things are working very well expect for this issue. I've written an external client that attempts to list the queue's deployed on a server (just testing the problem here). The problem is that I get inconsistent results.

      I've tried the following 4 provider url's in my InitialContext
      "jnp://nodeA:1100,jnp://nodeB:1100"
      "jnp://nodeB:1100,jnp://nodeA:1100"
      "jnp://nodeA:1100"
      "jnp://nodeB:1100"

      In all cases the lookup is not consistently successfuly. Sometimes it lists the queue's just fine, other times it gives me NameNotFound.

      Any thoughts would be appreciated.

        • 1. Re: Inconsistent JNDI Lookup
          Greg Paul Newbie

          Still no success with this.

          The wiki indicates that in jboss 4.x, that replication is handled via explicit RPC calls. I can only assume that the replication is not happening correctly, but I don't know when to start in attempting to determine what is at fault, any thoughts?

          • 2. Re: Inconsistent JNDI Lookup
            Brian Stansberry Master

            Are the queues deployed on both servers? A list call on HAJNDI will return references bound in HAJNDI directly, or, if nothing is bound in HAJNDI under the given name, the objects bound in the local JNDI tree on the server that handles the call. Because of this, if the queues are not bound in the global tree and are not deployed on both nodes, you will get inconsistent listings.

            • 3. Re: Inconsistent JNDI Lookup
              Greg Paul Newbie

              The queues are configured on both nodes. If one node goes down, the other will pick them up and deploy the queues. I can only see the queues in the jmx-console on one node at a time.

              Is there a way to see what is bound to HAJNDI without doing the failover to local jndi? I'd really just like to confirm that the queues are getting bound there, at least then I think it would be clear that i have a configuration issue.

              The stack trace indicates that the Global lookup fails, then the local one fails. (that is of course, *when* it fails, i can't tell where it was found when it is found).

              • 4. Re: Inconsistent JNDI Lookup
                Jerry Gauthier Apprentice

                You should be able to invoke list() or listBindings() to see what's stored in HA-JNDI. These calls don't access the local JNDI tree.

                One observation I have after working with HA_JNDI in JBoss 5 Alpha is that even though you specify a provider url such as "jnp://nodeA:1100", the "smart stub" is distributing your lookups based upon a designated load balancing policy. In the case of HA-JNDI, the load balancing policy is currently hard-coded to round robin. So your lookup directed towards nodeA:1100 could be handled by nodeB:1100. This should only matter if the object is located in HA-JNDI and replication fails or if you're bound different objects into local JNDI.

                I haven't tested this in JBoss 4 so I'm not sure how it's handled there. If you turn logging up and check the log, you can see which servers are handling your lookups and you should be able to determine whether this affects your results.

                Jerry