Wildfly 8.2 Remoting - 打开的频道太多

Wildfly 8.2 Remoting - Too many channels open

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

为了解决这个问题,我尝试在 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 上下文?

谢谢

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

有一个静态方法

EJBClientContext.getCurrent().close();