8 Replies Latest reply on Apr 7, 2005 12:19 PM by Scott Stark

    new InitialContext(remote) in servlet returns local jndi

    Dieter Cailliau Newbie


      Looking up a jndi tree of a remote jboss, works from java client, but when doing that from inside a servlet in a local jboss, it returns local jndi tree of local jboss.


      In a java client, i lookup context

      httpParentJndi.java.naming.factory.initial org.jboss.naming.HttpNamingContextFactory
      httpParentJndi.java.naming.factory.url.pkgs org.jboss.naming:org.jnp.interfaces;java.protocol.handler.pkgs

      In that context, i look for queue/Q, and post a message.

      On machine 20.11, i can see the message arriving (because there's a consumer there).

      When i do exectly the same client code, from inside a servlet inside a jboss on my client machine, it doesn't work anymore. The queue/Q is looked up in the local jndi of the jboss the client machine (running the servlet)! This results in a naming exception. It simply ignores my jndi context parameters (telling to look for the jndi remotely).