JBoss Community

JBoss As 7 problem with jndi port

created by Pedro Rocha in JNDI and Naming - View the full discussion

I got a problem with jndi port on Windows Vista 64-Bit using JBoss 7.

Using the command "netstat -na" the port 1099 doesn't appear and can not connect to it using the telnet.

Is there any special configuration for this port run on JBoss AS 7?

Because when I run the code below have the following error: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]

 

    private static final String JNDI_NAME_CALC = "java:global/primeiroejb-0.0.1-SNAPSHOT/SimpleCalculatorBean";
       
    @BeforeClass

    public static void obtainProxyReferences() throws Throwable
    {
   
     //configure appender eclipse
    BasicConfigurator.configure();

 

     Properties props = new Properties();
     props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
     props.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
     props.put(Context.PROVIDER_URL, "jnp://localhost:1099"); // HA-JNDI port.
    
     namingContext = new InitialContext(props);
      

       // Obtain EJB 3.1 Business Reference
       calc = (SimpleCalculatorBean) namingContext.lookup(JNDI_NAME_CALC);
    }

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community