EAP 6.1 EJB Remote Client using Clustering problems
smccormick Nov 13, 2013 6:25 PM
Alas, where to start?
I am trying to integrate with a new EAP 6.0.1 EJB Client jar that was provided to me. The client EJB jar/code was ported from WebLogic to JBoss EAP 6.0.1 (on the server) and needs to continue to support Tomcat and Weblogic, which it seems to be doing. We are currently using JBoss AS 5.1 as the remote client, but after running into major issues getting AS 5.1 to talk to EAP 6, we decided to port to EAP 6.1.x. Unfortunately even 6.1.x has issues. The first was the problem of modifying the context after it was created using the existing code in the client. I was finally able to overcome this using scoped context per https://access.redhat.com/site/solutions/231333. But there seems to be some problem with clustering and scoped contexts (or just clustering?) that I can't figure out. Specifically I get the following exception:
[RIPT_6EA8FE8D218940769ED05264B6500752][11:28:10.891] WARN(ConfigBasedEJBClientCont: 139) Could not register a EJB receiver for connection to [IP here]:4447: java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)
at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:75)
at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:130)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:100)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:68)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createIdentifiableEjbClientContext(EjbNamingContext.java:256)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.setupScopedEjbClientContextIfNeeded(EjbNamingContext.java:123)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.<init>(EjbNamingContext.java:98)
at org.jboss.ejb.client.naming.ejb.ejbURLContextFactory.getObjectInstance(ejbURLContextFactory.java:38)
at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:101)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at com.fares.common.util.jndi.ServiceLocatorCache.locateEJBRemoteProxy(ServiceLocatorCache.java:165)
at com.fares.common.util.jndi.ServiceLocatorCache.getEJBRemote(ServiceLocatorCache.java:104)
at com.fares.common.base.delegate.DelegateBase.getServiceHandleNew(DelegateBase.java:167)
at com.fares.common.base.delegate.DelegateBase.getServiceObjectHolder(DelegateBase.java:50)
at com.fares.smartsearch.ifc.delegate.SmartSearchBD.getPermissableMlsBoards(SmartSearchBD.java:324)
at com.corelogic.ript.coremls.vendor.services.CLiQService.getPermissibleUseMLSBoards(CLiQService.java:166)
at com.corelogic.ript.coremls.vendor.dto.CoreMLSPermissibleUseGeoCoverage.getPermissibleMLSBoards(CoreMLSPermissibleUseGeoCoverage.java:125)
at com.corelogic.ript.lmar.report.LMARReport.runReport(LMARReport.java:189)
at com.corelogic.ript.web.controllers.RiptServiceController.handleRequestInternal(RiptServiceController.java:189)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
at java.lang.Thread.run(Thread.java:722)
Having walked thru the client and Jboss code locally, this exception is preceded by a 5 second pause every time it happens, and for the application it happens about 6-8 times, which means the report takes an additional +30 seconds to execute, and sometime fails outright. Does anyone have any idea of why this is happening or what I might be doing wrong?
The code I am calling to get the context looks like:
private static Properties getEJBClientContextPropsEAP(String multipleHostIps,String remotingUserName,String remotingPassword)
{
Properties env = new Properties();
env.put("org.jboss.ejb.client.scoped.context", "true");
env.put("javax.naming.Context.URL_PKG_PREFIXES", "org.jboss.ejb.client.naming");
env.put("remote.clusters","ejb");
env.put("reconnect.tasks.timeout","2000");
env.put("remote.cluster.ejb.connect.timeout","2500");
env.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
env.put("remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS","false");
env.put("remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT","false");
env.put("remote.cluster.ejb.connect.options.org.xnio.Options.SSL_ENABLED","false");
env.put("remote.cluster.ejb.username",remotingUserName);
env.put("remote.cluster.ejb.password",remotingPassword);
env.put("deployment.node.selector","com.fares.common.util.jndi.RoundRobinDeploymentNodeSelector");
appendClusterHostPropeties(multipleHostIps, env, remotingUserName, remotingPassword);
return env;
}
...
String[] urlValues = argProviderUrl.split(":");
if(!SELECTOR_IS_SET.get())
{
Properties env = getEJBClientContextPropsEAP(argProviderUrl,argUser,argPass);
ctx = new InitialContext(env);
}
The strange thing is that some of the connections are working, and data is getting back but some seem to fail. The application that I can running is also multithreaded making several EJB calls at one time, though I have seen this error even when running them sequentially.
Thanks for you help in advance!
Stephen