wildfly jndi(java.net.connectException:连接拒绝:无进一步的信息)]

发布于 2025-02-11 18:55:33 字数 1532 浏览 1 评论 0原文

我在野生蝇10上使用jndi。 查找时,我有一个错误: “ java.net.connectException:连接拒绝:没有更多信息”

我的jboss-ejb-client.properties在类路径中未读取事件。 因此,我将数据放在初始信息中。

    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. 远程似乎是唯一可用的协议。 2))其他地方是否需要任何配置?

TX寻求帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文