【问题标题】:Wildfly 8.2 Remoting - Too many channels openWildfly 8.2 远程处理 - 打开的频道太多
【发布时间】:2015-08-12 21:23:50
【问题描述】:

以下是我的远程配置,当我进行远程处理时一切正常。问题出在某个点上,打开了太多通道,因此其他远程调用因此问题而失败。

为了解决这个问题,我尝试在 finally 语句中关闭上下文并得到这个问题:

INFO  [org.jboss.ejb.client.remoting] 
    (Remoting "config-based-ejb-client-endpoint" task-9) 
EJBCLIENT000016: 
    Channel Channel ID c50b300b (outbound) of Remoting connection 
    29298b25 host/127.0.0.1:8080 can no longer process messages
...failed with exception -: 
        java.lang.IllegalStateException: 
        EJBCLIENT000027: No EJBReceiver available for node name  

String info = "remote.connection.default";
props.put(info + ".host", StringUtils.substringBefore(url, ":"));
props.put(info + ".port", StringUtils.substringAfter(url, ":"));
props.put(info + ".username", "username");
props.put(info + ".password", "password");
props.put(info + ".connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "true");
props.put(info + ".connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
props.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
props.put("org.jboss.ejb.client.scoped.context", "true");

InitialContext ctx = new InitialContext(props);

我该如何解决这个问题?我错过了财产吗?如何关闭 ejb 上下文而不出现此问题?

谢谢

【问题讨论】:

    标签: java jboss wildfly remoting


    【解决方案1】:

    有一个静态方法

    EJBClientContext.getCurrent().close();
    

    【讨论】:

      【解决方案2】:

      在静态地图的帮助下,我能够在稍后关闭上下文。

      【讨论】:

      • 我遇到了同样的问题。你能发布你的解决方案的代码吗?
      • 基本上我重用了静态地图中的上下文,并在一段时间没有使用上下文后关闭它,所以当我关闭它时,在这个上下文的后台没有任何操作。正确的方法通常是在 finally 语句中关闭上下文。
      猜你喜欢
      • 2019-10-30
      • 2015-02-02
      • 2016-03-17
      • 2016-08-21
      • 2017-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-08
      相关资源
      最近更新 更多