wildfly jndi (java.net.ConnectException: Connection refused: no further information)]

Viewed 50

I am using jndi on wildfly 10. when doing the lookup, i've got an error : "java.net.ConnectException: Connection refused: no further information"

my jboss-ejb-client.properties is not read event in the classpath. So I put the data in the InitialContext.

    private static Context createInitialContext() throws NamingException {
        Properties jndiProperties = new Properties();
        jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

        jndiProperties.put(Context.URL_PKG_PREFIXES,        "org.jboss.ejb.client.naming");
//      jndiProperties.put(Context.PROVIDER_URL,            "remote://localhost:8089");
        jndiProperties.put(Context.PROVIDER_URL,            "remote://localhost:4447");
        jndiProperties.put("jboss.naming.client.ejb.context", true);

        jndiProperties.put("endpoint.name","client-endpoint");
        jndiProperties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED","false");
        jndiProperties.put("remote.connections","default");
        jndiProperties.put("remote.connection.default.host","localhost");
        jndiProperties.put("remote.connection.default.port","4447");
        jndiProperties.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS","false");
        jndiProperties.put("remote.connection.default.username","***");
        jndiProperties.put("remote.connection.default.password","***");
        return new InitialContext(jndiProperties);
    }
  1. remote seems to be the only protocol available. 2)) Is there any configuration needed somewhere else?

tx for ur help.

0 Answers
Related