I am using remote connection in java applet using the following code.
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);
Here the SECURITY_PRINCIPAL is created using the add-user.sh script. The the applet loads, everything works well. But after sometime in java console , a message appears saying
Jul 13, 2016 3:04:21 PM org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver handleEnd INFO: EJBCLIENT000016: Channel Channel ID 98a848d6 (outbound) of Remoting connection 22d8b2a8 to cms8sf.cdotd.ernet.in/192.168.5.240:8080 can no longer process messages.
And after that , whenever I try to access any method of remote bean Exception in thrown.
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)
I am quite unsure why this is happening. Can someone please help me. Thank in advance. I am using java 1.8 and wildfly 9.0.2.
Perhaps, this option will help you
remote.connection.default.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL=5000
it's some kind of a ping
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.