gpt4 book ai didi

java - Wildfly 8.2 远程处理 - 打开的 channel 太多

转载 作者:太空宇宙 更新时间:2023-11-04 13:33:06 27 4
gpt4 key购买 nike

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

为了解决这个问题,我尝试在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);

如何解决这个问题?我是否缺少属性(property)?如何关闭 ejb 上下文而不出现此问题?

谢谢

最佳答案

有一个静态方法

EJBClientContext.getCurrent().close();

关于java - Wildfly 8.2 远程处理 - 打开的 channel 太多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31975671/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com