1 Reply Latest reply on Jul 5, 2004 4:52 PM by Joao Daniel

    Problemas with JNDI

    Joao Daniel Newbie

      I'm running Jboss 3.2.4 under a RH 7.3 box.
      I've deployed a session bean.
      When I run the client code bellow, from the same box I've my Jboss Installed it runs well, but when I run it from another computer (windows) in the same network, it fails in the lookup line and Throws the following exception
      Java.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: ….”

      I am sure the service is available when reach the 1099 port by telnet, for instance, ir replays me something like this

      ↨°TÓ☻xp'¼ÃÂ�t▬http://develop01:8083/q~q~uq~♥└¼ÃÂ�sr org.jnp.server.NamingServer_Stub

      I know I am doing something wrong, but I do not have a clue where. The Linux box are not behind a firewall.

      Properties prop = new Properties();
       prop.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
       prop.put("java.naming.factory.url", "org.jboss.naming:org.jnp.interfaces");
       prop.put("java.naming.provider.url", "jnp://");
       BandeiraEjbHome bh = null;
       Context ctx = new InitialContext(prop);
       Hashtable ht = ctx.getEnvironment();
       Iterator it = (Iterator) ht.elements();
       while (it.hasNext()){
       System.out.println("Environment--> " +it.next());
       Object obj = ctx.lookup("CadBandeira");
       System.out.println("After lookup");
       bh = (BandeiraEjbHome)
       javax.rmi.PortableRemoteObject.narrow(obj, BandeiraEjbHome.class);
       }catch (NamingException e){
       ShowOnScreen sOnS = new ShowOnScreen();
       sOnS.mostrar("Erro Conectando com o Servidor"," ",e);