title: No EJB receiver available for handling [appName:, moduleName:jmschat, distinctName:] when invoking bean method
body: <p>I am able to successfully lookup the remote interface, but when I call the method of that bean, it gives the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:jmschat, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@413157
  at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:727)
  at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
  at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
  at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
  at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
  at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
  at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
  at com.sun.proxy.$Proxy0.sendMessage(Unknown Source)
  at Client.main(Client.java:64)
  </code></pre>
  
  <p>My Client code is:</p>
  
  <pre><code>    public static void main(String[] args) {
  
      Properties jndiProperties=new Properties();
  
      jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
      jndiProperties.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");
      jndiProperties.put("jboss.naming.client.ejb.context", true);
      jndiProperties.put(Context.SECURITY_PRINCIPAL, "admin");
      jndiProperties.put(Context.SECURITY_CREDENTIALS, "********");
      jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
      //jndiProperties.put("jboss.naming.client.ejb.context", true);
  
      InitialContext ctx = null;
  
      try {
  
          ctx = new InitialContext(jndiProperties);
  
      } catch (NamingException e) {
  
          e.printStackTrace();
  
      }
  
  
      MessageProducerLocal messageProducerRemote= null;
      try {
         // assert ctx != null;
          String appName="";
          String moduleName="jmschat";
          String distinctName="";
          String beanName=MessageProducer.class.getSimpleName();
          String viewClassName=MessageProducerLocal.class.getName();
          //messageProducerLocal = (MessageProducerRemote) ctx.lookup("ejb:module/jmschat/MessageProducer!demo.jms.MessageProducerRemote");
          messageProducerRemote = (MessageProducerLocal) ctx.lookup("ejb:"+appName+"/"+moduleName+"/"+distinctName+"/"+beanName+"!"+viewClassName);
      } catch (NamingException e) {
          e.printStackTrace(); 
      }
  
      messageProducerRemote.sendMessage("hello...this is msg");
   }
  </code></pre>
  
  <p>The line that gives me the error is:</p>
  
  <pre><code>messageProducerRemote.sendMessage("hello...this is msg");
  </code></pre>
  
  <p>I am using EJB 3.1 and jboss EAP 6.1.I am new to both.</p>
  
  <p>I searched for this issue. But everywhere I found out this to be related to lookup.</p>
  
  <p>Any help and suggestion is welcomed. Thanks and Regards</p>