【问题标题】:remote connection dropped after some time in wildflyWildfly 一段时间后远程连接断开
【发布时间】:2016-07-13 09:42:35
【问题描述】:

我正在使用以下代码在 java 小程序中使用远程连接。

    Hashtable jndiProps = new Hashtable<Object,Object>();
    jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
    jndiProps.put(Context.PROVIDER_URL, "http-remoting://" + myhost + ":" + "8080");
    jndiProps.put("jboss.naming.client.ejb.context", true);
    jndiProps.put("org.jboss.ejb.client.scoped.context", true);;
    //jndiProps.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");
    jndiProps.put("endpoint.name", "client-endpoint");
    jndiProps.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", false);
    jndiProps.put("remote.connections", "default");
    jndiProps.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", false);
    jndiProps.put("remote.connection.default.host", myhost);
    jndiProps.put("remote.connection.default.port", "8080");
    jndiProps.put(Context.SECURITY_PRINCIPAL, "demouser");
    jndiProps.put(Context.SECURITY_CREDENTIALS, "demouser123");
    InitialContext ctx = null;
    try {
        ctx = new InitialContext(jndiProps);
    } catch(NamingException nex) {
        nex.printStackTrace();
    } catch(Exception ex) {
        ex.printStackTrace();
    }
    RemoteInterface remote = (RemoteInterface)ctx.lookup(ejbUrl);

这里 SECURITY_PRINCIPAL 是使用 add-user.sh 脚本创建的。小程序加载,一切正常。但是在 java 控制台中的某个时间后,会出现一条消息,说

2016 年 7 月 13 日下午 3:04:21 org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver handleEnd 信息:EJBCLIENT000016:到 cms8sf.cdotd.ernet.in/192.168.5.240:8080 的远程连接 22d8b2a8 的通道通道 ID 98a848d6(出站)无法再处理消息。

之后,每当我尝试访问远程 bean 的任何方法时都会抛出异常。

java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:app, moduleName:app-ejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@490f0e4e
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:774)

我很不确定为什么会这样。有人可以帮帮我吗。预先感谢。 我使用的是 java 1.8 和 wildfly 9.0.2。

【问题讨论】:

    标签: java web javabeans ejb-3.0 wildfly-9


    【解决方案1】:

    也许,这个选项会帮助你

    remote.connection.default.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL=5000

    这是某种 ping

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-22
      • 2020-04-14
      • 1970-01-01
      • 1970-01-01
      • 2012-12-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多