title: Remote EJB Lookup via JNDI on Jboss EAP 6.4
body: <p>I'm trying to run the ejb-remote example from here: <a href="https://github.com/jboss-developer/jboss-eap-quickstarts/tree/6.4.x/ejb-remote" rel="nofollow noreferrer">Jboss eap quickstart</a></p>
  <p>I don't see any issues when I run the server and client on the same machine. However there are issues if the client is executed from a different machine than on server.</p>
  <p>I'm assuming the examples provided by jboss team should be working out of the box. I also read article on  <a href="https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI" rel="nofollow noreferrer">https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI</a> and various online blogs. Please let me know if I am missing anything obvious. Trying to get the remote client working for couple of days now. :(</p>
  <p>ENV:
  Server deployed on Jboss EAP 6.4. JDK/JAVA version 8.</p>
  <p>Stack trace:</p>
  <pre><code>java.io.EOFException: XNIO000812: Connection closed unexpectedly
      at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:416)
      at org.xnio.http.HttpUpgrade$HttpUpgradeState.flushUpgradeChannel(HttpUpgrade.java:369)
      at org.xnio.http.HttpUpgrade$HttpUpgradeState.access$900(HttpUpgrade.java:165)
      at org.xnio.http.HttpUpgrade$HttpUpgradeState$ConnectionOpenListener.handleEvent(HttpUpgrade.java:340)
      at org.xnio.http.HttpUpgrade$HttpUpgradeState$ConnectionOpenListener.handleEvent(HttpUpgrade.java:320)
      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      at org.xnio.nio.WorkerThread$ConnectHandle.handleReady(WorkerThread.java:324)
      at org.xnio.nio.WorkerThread.run(WorkerThread.java:559)
      at ...asynchronous invocation...(Unknown Source)
      at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:294)
      at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:416)
      at org.jboss.ejb.client.remoting.EndpointPool$PooledEndpoint.connect(EndpointPool.java:192)
      at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:153)
      at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:133)
      at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:78)
      at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)
      at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:161)
      at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:118)
      at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)
      at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:281)
      at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:291)
      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:178)
      at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
      at com.sun.proxy.$Proxy0.add(Unknown Source)
      at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:57)
      at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.main(RemoteEJBClient.java:38)
  
  Exception in thread &quot;main&quot; java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:jboss-ejb-remote-server-side, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@6eebc39e
      at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:798)
      at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128)
      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
      at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255)
      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200)
      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183)
      at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
      at com.sun.proxy.$Proxy0.add(Unknown Source)
      at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:57)
      at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.main(RemoteEJBClient.java:38)
   
  </code></pre>
  <p><strong>UPDATES 04/29:</strong></p>
  <p><em>JBOSS Startup log snippets:</em></p>
  <pre>
  9:42:56,600 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]
  09:42:56,978 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) JBWEB003001: Coyote HTTP/1.1 initializing on : **http-/0.0.0.0:8080**
  09:42:57,010 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) JBWEB003000: Coyote HTTP/1.1 starting on: **http-/0.0.0.0:8080**
  09:42:57,083 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
  09:42:57,117 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory /opt/deployments/jboss/jboss-eap-6.4/standalone/deployments
  09:42:57,124 INFO  [org.jboss.as.remoting] (MSC service thread 1-8) JBAS017100: Listening on 127.0.0.1:9999
  09:42:57,124 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100:Listening on **0.0.0.0:4447**
  </pre>
  <p><em>Netstat output:</em></p>
  <p>tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      2917/java</p>
  <p>tcp        0      0 0.0.0.0:4447            0.0.0.0:*               LISTEN      2917/java</p>