1 Reply Latest reply on Dec 8, 2005 11:46 AM by tanveer

    JNDI Lookup Problem

    tanveer

      Hi All,

      I want to call an EJB deployed on JBoss Server 3.2.3. I am using a java claine to call it from another machine on the network using this code:

      try {
       prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
       prop.put(Context.PROVIDER_URL, "jnp://135.131.147.120:1099");
       prop.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
       prop.put("jnp.disableDiscovery", "true");
       ctx = new javax.naming.InitialContext(prop);
       } catch (NamingException ex) {
       ex.printStackTrace();
       }
      
       try {
       String JNDIHomeName = "com.teradata.tap.ava.ejb.AVATestBean";
       Object HomeObj = ctx.lookup(JNDIHomeName);
       AVATestRemoteHome Home = (AVATestRemoteHome ) PortableRemoteObject.narrow(HomeObj,AVATestRemoteHome.class);
       remote = (AVATestRemote) PortableRemoteObject.narrow(Home.create(), AVATestRemote.class);
       } catch (Exception ex) {
       ex.printStackTrace();
       }


      I am able to run this client successfully from the same machine where my server is running but when i try that from another machine it gives me this exception:

      javax.naming.CommunicationException: Could not obtain connection to any of these urls: 135.131.147.120:1098
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1194)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
       at javax.naming.InitialContext.lookup(InitialContext.java:347)
       at com.teradata.tap.ava.client.AVATestBeanClient.execute(AVATestBeanClient.java:103)
       at com.teradata.tap.ava.client.AVATestBeanClient.main(AVATestBeanClient.java:295)
      

      ..............
      Can anybody help me on this, thanks in advance.

      Note: i am using JBoss 3.2.3 and JDK 1.4.2_08

      Tanveer

        • 1. Re: JNDI Lookup Problem
          tanveer

          Hi All,

          I figured out by digging into the firewall logs that port 1099 (JNDI listener port) is blocked in our network firewall. So after removing it from the firewall protected list of ports, my client is working perfectly fine, connecting the EJB that i have deployed on another machine on the network.