Help! Operation failed with status WAITING + No EJB receiver available for handling
ybxiang.china Aug 13, 2012 11:16 PMDear all,
I met a strange case during EJB invocation.
Prepare:
1. My JBoss 7.1.1 Server is bound to IP 59.78.26.210.
standalone.bat -b=59.78.26.210
2. My client code:
String jndiName = "ejb:nms-server-ear/nms-server-ejb//SecuredRemoteSession!" + ISecuredRemoteSession.class.getName();//ear:good Properties p = new Properties(); p.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "true"); p.put("remote.connections", "default"); p.put("remote.connection.default.host", 59.78.26.210); p.put("remote.connection.default.port", "4447"); p.put("remote.connection.default.username", username); p.put("remote.connection.default.password", password); p.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false"); p.put("remote.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS-LOCAL-USER"); p.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false"); p.put("remote.connection.default.connect.options.org.xnio.Options.SSL_STARTTLS", "true"); EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(p); ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc); EJBClientContext.setSelector(selector); Properties props = new Properties(); props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); InitialContext context = new InitialContext(props); securedRemoteSessionProxy = (ISecuredRemoteSession)context.lookup(jndiName); securedRemoteSessionProxy.doSomething();
Test.1
If my client is on the same server which EJB is deployed.
Everything is OK.
Test.2
If my client is on another host which is 10 miles away from the jboss 7.1.1 server (actually, this case can be reproduced if the two hosts are in same local area network but with different IP section),
(a) If I run above client code, then I got bellow exception:
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.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:121) at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:78) at com.ybxiang.nms.gui.platform.connection.ServerLink.initSecuredRemoteSession(ServerLink.java:354) at com.ybxiang.nms.gui.platform.connection.ServerLink.login(ServerLink.java:187) at com.ybxiang.nms.gui.platform.connection.ServerLink.login(ServerLink.java:178) at com.ybxiang.nms.gui.platform.login.LoginWizard$2.run(LoginWizard.java:121) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)" !ENTRY com.ybxiang.nms.gui.platform 0 0 2012-08-12 17:09:33.921 !MESSAGE (Timezone is CST.) ;188; org.jboss.ejb.client: "JBoss EJB Client version 1.0.5.Final" !ENTRY com.ybxiang.nms.gui.platform 0 0 2012-08-12 17:09:43.953 !MESSAGE (Timezone is CST.) ;188; com.ybxiang.nms.gui.platform.connection.ServerLink: "java.lang.IllegalStateException: No EJB receiver available for handling [appName:nms-server-ear,modulename:nms-server-ejb,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@1650fb1"
(b) If I debug above client code lines one by one:
- At first I run the client till "EJBClientContext.setSelector(selector);", I will get the first exeption "Operation failed with status WAITING...".
- Now, wait 5 seconds,
- run the remainled code lines.
- The second exception "java.lang.IllegalStateException: No EJB receiver available for handling..." disappeared! Everything works well!
I tryied (a) and (b) many times and always get the same result.
I searched the jboss forum and other forums, nothing useful is found.
Would you tell me why?
-
standalone.xml 18.8 KB