Standalone EJB client fails to connect with RuntimeException: Operation failed with status WAITING in JBoss EAP6
Environment
- JBoss Enterprise Application Platform (EAP)
- 6.2.x
- 6.1.x
- 6.0.x
Issue
- When running EJB tests with a standalone client I get the above error below:
WARN [ConfigBasedEJBClientContextSelector] Could not register a EJB receiver for connection to localhost: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.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:119)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:76)
at org.jboss.ejb.client.EJBClientContext.<clinit>(EJBClientContext.java:77)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:120)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
at $Proxy0.hello(Unknown Source)
at com.jboss.examples.ejb3.client.Client.main(Client.java:31)
Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:helloWorld-ejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@71060478
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:588)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
at $Proxy0.hello(Unknown Source)
at com.jboss.examples.ejb3.client.Client.main(Client.java:31)
Java Result: 1
- We are seeing this when our standalone client tries to call an ejb in JBoss EAP 6
22:56:17,177 WARN [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] Could not register a EJB receiver for connection to localhost:4447: java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
...
Resolution
Configure the jboss-ejb-client.properties remote.connection.default.host & remote.connection.default.port to point to the correct host and port that the server is running on and assure that the client can access the host and port and that there is not a firewall or network issue. Update to the latest Oracle JDK 7 and check release notes for networking bugs.
Root Cause
The error message "Operation failed with status WAITING" means that the client was unable to connect to the host/port and timed out. This is caused by having the wrong host/port configuration in the client's jboss-ejb-client.properties or by a network issue such as firewall, network connectivity, mis-configured DNS entry, or invalid /etc/hosts entry.
Diagnostic Steps
- Check the host / port the server that on which the server is listening for EJB requests.
- The remoting port is defined in the standard-sockets section of the JBoss EAP's profile xml (default: 4447)
- The socket-binding group references the default-interface, check that interface to see what interface is being bound
- Use ping to ping the host and confirm it responds and the IP is correct
- Use telnet or another tool to confirm that the client machine can connect to the host/port specified in the jboss-ejb-client.properties
- Check the /etc/hosts to see if it is pointing the host the client is using to the wrong IP address
- Check for JDK bug such as Oracle JDK 7 <= 1.7.0_4 for Mac OS X
- See if there are any delays when running dig (DNS lookup utility)
dig -x 127.0.0.1
- Confirm JBoss is the process listening on the remoting port. This command will shows what process is listening on port 4447 and compare against the JBoss process id from ps
lsof -n -i4TCP:4447 | grep LISTEN
ps aux | grep java
- Check if there any firewall / virus software active. It is reported some virus software may block the connection / communication if the client tries to open / close the connection to server repeatedly. This often happens in load testings.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.