Exception after long duration of non-usage of applications.
Issue
- After long duration of non-usage of applications, we get following exception while getting EJB instance.
-
Issue is with the very first click on application, subsequently next click on-wards it works smoothly.
-
Please note that our EJB instance context is "static".
INFO [org.jboss.ejb.client.remoting] (Remoting "b2c_private" task-2) EJBCLIENT000016: Channel Channel ID a7b81fef (outbound) of Remoting connection 7a397ed0 to null can no longer process messages
ERROR [stderr] (localhost/127.0.0.1:7312-2) java.lang.reflect.UndeclaredThrowableException
...
148 ERROR [stderr] (localhost/127.0.0.1:7312-2) Caused by: java.io.IOException: Channel Channel ID a7b81fef (outbound) of Remoting connection 7a397ed0 to null has been closed
- Our EJB Client code looks like this:
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.ejb.client.EJBClientConfiguration;
import org.jboss.ejb.client.EJBClientContext;
import org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration;
import org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector;
public enum MyEjbClient {
private String docsisLookupStr;
private final Context context;
private DocsisServiceEjbClient() {
String host = getRemoteHost();
final Properties clientProps = new Properties();
clientProps.setProperty("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
clientProps.setProperty("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
clientProps.setProperty("remote.connections", "default");
clientProps.setProperty("remote.connection.default.host", host);
clientProps.setProperty("remote.connection.default.port", "4447");
final EJBClientConfiguration clientConfiguration = new PropertiesBasedEJBClientConfiguration(clientProps);
final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(clientConfiguration);
EJBClientContext.setSelector(selector);
final Properties jndiProperties = new Properties();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
try {
context = new InitialContext(jndiProperties);
} catch (NamingException e) {
throw new RuntimeException(e);
}
String docsisEjbName = "MyServiceBean";
docsisLookupStr = getLookupString(docsisEjbName, "myEjbName");
}
- is possible to setup a keepalive on the RMI remote-outbound-connection ?
Environment
- JBoss Enterprise Application Platform (EAP)
- 6.0.x
- 6.1.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.