简体   繁体   English

空闲时间后,命名上下文停止工作JBoss EAP 6.4.0

[英]Naming Context stop working after idle time JBoss EAP 6.4.0

I am using JBoss EAP 6.4 to deploy an EJB ear file. 我正在使用JBoss EAP 6.4部署EJB耳文件。 Everything works fine but if Swing application idle for some time(1 hour or so) and then try to access any feature from swing client, client got crashed with below exception: 一切正常,但如果Swing应用程序闲置了一段时间(大约1小时),然后尝试从swing客户端访问任何功能,则客户端崩溃,发生以下异常:

javax.naming.NamingException: Unable to invoke lookup, status=WAITING
     at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:98)
     at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.lookup(RemoteNamingStoreV1.java:95)
     at org.jboss.naming.remote.client.HaRemoteNamingStore$1.operation(HaRemoteNamingStore.java:275)
     at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:132)
     at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:271)
     at org.jboss.naming.remote.client.RemoteContext.lookupInternal(RemoteContext.java:104)
     at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:93)
     at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:146)
     at javax.naming.InitialContext.lookup(Unknown Source)

It does not able to resolve jndi with cached context at client side. 它无法在客户端使用缓存的上下文解析jndi。

Context created in client using below properties: 使用以下属性在客户端中创建的上下文:

    table.put("remote.connection.one.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
                    table.put("remote.connection.one.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS-LOCAL-USER");

table.put("remote.clusters", "ejb");
                    table.put("remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
table.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
table.put("jboss.naming.client.ejb.context", true);
                    table.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
    table.put( Context.SECURITY_PRINCIPAL, System.getProperty( Context.SECURITY_PRINCIPAL));
    table.put( Context.SECURITY_CREDENTIALS, System.getProperty( Context.SECURITY_CREDENTIALS));
                    table.put("jboss.naming.client.remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED","true");
                    table.put("jboss.naming.client.connect.options.org.xnio.Options.SSL_STARTTLS","true");
    table.put("jboss.naming.client.connect.timeout", "3000000");
    table.put( Context.PROVIDER_URL,PROVIDER_URL);

    context = new javax.naming.InitialContext( table); 

Please help me to understand why after an idle time context is not able to lookup? 请帮助我了解为什么在空闲时间上下文后无法查找?

Finally i found the solution. 终于我找到了解决方案。 In JBoss EAP 6.4 using old JNDI approach creates issues and does not support JBoss features like HeartBeat_Interval etc. 在JBoss EAP 6.4中,使用旧的JNDI方法会产生问题,并且不支持HeartBeat_Interval等JBoss功能。

Best way to lookup in Jboss is to use EJB Client lookup approch. 在Jboss中查找的最佳方法是使用EJB客户端查找方法。 This solves all issues related to crash etc. https://docs.jboss.org/author/display/AS71/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project 这解决了与崩溃等有关的所有问题。https://docs.jboss.org/author/display/AS71/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM