title: JNDI No EJB receiver available for handling
body: <p>I have a problem with my EJBTest.</p>
  
  <p>I have installed WildFly and configured user management and application management.</p>
  
  <p>I wrote an EJB 3.0 and deployed it:</p>
  
  <pre><code>@Stateless
  @Remote(NewSessionBeanRemote.class)
  public class NewSessionBean implements NewSessionBeanRemote {
  
      List&lt;String&gt; bookShielf;
  
      /**
       * Default constructor. 
       */
      public NewSessionBean() {
          bookShielf = new ArrayList&lt;String&gt;();
      }
  
      @Override
      public void addBook(String bookName) {
          bookShielf.add(bookName);
      }
  
      @Override
      public List getBook() {
          return bookShielf;
      }
  }
  </code></pre>
  
  <p>Afterwards, I wrote a simple client to connect it:</p>
  
  <pre><code>private static void invokeStatelessBean() throws NamingException {
      // Let's lookup the remote stateless calculator
      NewSessionBeanRemote remoteEjb = lookupRemoteSessionBean();
      System.out.println("Obtained a remote stateless calculator for invocation");
      String bookName = "TEST book";
      remoteEjb.addBook(bookName);
  }
  
  private static NewSessionBeanRemote lookupRemoteSessionBean() throws NamingException {
  
      final Hashtable jndiProperties = new Hashtable();
      jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
      jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
      jndiProperties.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:10090");
      jndiProperties.put(Context.SECURITY_PRINCIPAL, "ejb"); //this is the application user name, not management! it's correct?
      jndiProperties.put(Context.SECURITY_CREDENTIALS, "ejb");//this is the application password, not management! it's correct?
      jndiProperties.put("jboss.naming.client.ejb.context", true);
      final Context context = new InitialContext(jndiProperties);
      final String appName = "";
      final String moduleName = "EjbComponent";
      final String distinctName = "";
      final String beanName = NewSessionBean.class.getSimpleName();
      final String viewClassName = NewSessionBeanRemote.class.getName();
      System.out.println("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);
      return (NewSessionBeanRemote) context.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);
  }
  </code></pre>
  
  <p>Both username and password are the application user credential, not management! Is it correct?</p>
  
  <p>I'm receiving this error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:EjbComponent, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@5034c75a
        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.$Proxy2.addBook(Unknown Source)
        at com.studio.java.client.EjbTester.invokeStatelessBean(EjbTester.java:34)
        at com.studio.java.client.EjbTester.main(EjbTester.java:21)</p>
  </blockquote>
  
  <p>I don't know why! Anyone have an idea?</p>