title: EJBCLIENT000025: No EJB receiver available for handling, how to fix?
body: <p>I'm creating a simple client-server Java EE application with EJB, using IntelliJ IDEA 2016 and WildFly 10.</p>
  
  <p>I've created a new <a href="http://s32.postimg.org/3re6cwmjp/ejb_struct.png" rel="nofollow">Java EE Project</a> <em>EJB_final_test</em> and added two modules:</p>
  
  <ul>
  <li><p>Java module <em>EJB_test_client</em></p></li>
  <li><p>EJB module <em>EJB_test_server</em></p></li>
  </ul>
  
  <p>Then I <a href="http://postimg.org/image/vkmm10fq9/" rel="nofollow">set artifact</a> as Java EE Application Archive which creates an <em>EJBTestEAR.ear</em> file for <em>EJB_test_server</em> module.</p>
  
  <p>I've deployed this EAR file on WildFly server. Server runs well and it successfully deploys the artifact on start up.</p>
  
  <p>Here is my <em>jboss-ejb-client.properties</em> file:</p>
  
  <pre><code>remote.connections=default
  remote.connection.default.host=localhost
  remote.connection.default.port=8180
  remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
  remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
  </code></pre>
  
  <p>Here is my code for only class <code>ClientTest</code> in <em>EJB_test_client</em> module:</p>
  
  <pre><code>package test;
  
  import facade.TestFacadeBeanRemote;
  import javax.naming.Context;
  import javax.naming.InitialContext;
  import java.util.Properties;
  
  public class ClientTest {
  
      public static void main(String[] args) throws Exception {
  
          Properties jndiProperties = new Properties();
          jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
          Context ctx = new InitialContext(jndiProperties);
          TestFacadeBeanRemote remote = (TestFacadeBeanRemote) ctx.lookup("ejb:EJBTestEAR/EJB_test_server//TestFacadeBean!facade.TestFacadeBeanRemote");
  
          System.out.println(remote.tstPlus("Hello", "World"));
      }
  
  }
  </code></pre>
  
  <p>Here is code for classes <code>TextExecutiveBean, TestFacadeBean, TestFacadeBeanRemote</code> which are all in module EJB_test_server:</p>
  
  <ul>
  <li><p><em>TestExecutiveBean</em> class:</p>
  
  <pre><code>package executive;
  
  import javax.ejb.LocalBean;
  import javax.ejb.Stateless;
  
  @Stateless
  @LocalBean
  public class TestExecutiveBean {
  
      public String doPlusOperation(String str1, String str2) {
          return str1 + " " + str2 + " " + str1;
      }
  }
  </code></pre></li>
  <li><p><em>TestFacadeBean</em> class:</p>
  
  <pre><code>package facade;
  
  import javax.ejb.EJB;
  import javax.ejb.Stateless;
  import executive.TestExecutiveBean;
  
  @Stateless
  public class TestFacadeBean implements TestFacadeBeanRemote {
  
      @EJB
      private TestExecutiveBean test2;
  
      public String tstPlus(String str1, String str2) {
          return test2.doPlusOperation(str1, str2);
      }
  }
  </code></pre></li>
  <li><p><em>TestFacadeBeanRemote</em> interface:</p>
  
  <pre><code>package facade;
  
  import javax.ejb.Remote;
  
  @Remote
  public interface TestFacadeBeanRemote {
  
      public String tstPlus(String str1, String str2);
  }
  </code></pre></li>
  </ul>
  
  <p>When I'm trying to run <code>ClientTest</code> main method, which tries to communicate with server for finding <code>tstPlus()</code> method in <em>EJBTestEAR</em>, I'm getting the following exception:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalStateException:
    EJBCLIENT000025: <strong>No EJB receiver available for handling</strong>
    [appName:EJBTestEAR, moduleName:EJB_test_server, distinctName:]
    combination for invocation context
    org.jboss.ejb.client.EJBClientInvocationContext@184f6be2  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.tstPlus(Unknown Source)    at
    test.ClientTest.main(ClientTest.java:20)  at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)     at
    com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)</p>
  </blockquote>
  
  <p>Please, how can I fix this error? Am I doing something wrong? Is configuration of my artifact which I deploy on the server right?</p>