title: Unable to get remote ejb from client application in the context of JBoss
body: <p><strong>Client app</strong></p>
  
  <pre><code>package com.jeet.client;
  
  import java.util.Properties;
  
  
  import javax.naming.Context;
  import javax.naming.InitialContext; 
  import javax.naming.NamingException;
  import com.jeet.interfaces.HelloWorldRemoteBean;
  import com.jeet.org.HelloWorldBean;
  
  public class EJBApplicationClient {
  
      public static void main(String[] args) {
          HelloWorldRemoteBean bean = doLookup();
          System.out.println(bean.sayHello()); // 4. Call business logic
      }
  
      private static HelloWorldRemoteBean doLookup() {
  
  
          Properties props = new Properties();
          props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
          props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
          props.put(Context.PROVIDER_URL, "jnp://127.0.0.1:8080");
  
  
          HelloWorldRemoteBean bean = null;
          try{
          InitialContext ctx = new InitialContext(props);
  
          System.out.println("connecting.."); 
              String lookupName = getLookupName();
  
              bean = (HelloWorldRemoteBean) ctx.lookup(lookupName);
              System.out.println("done"); 
          } catch (NamingException e) {
              e.printStackTrace();
          }
          return bean;
      }
  
      private static String getLookupName() {
  /* 
  The app name is the EAR name of the deployed EJB without .ear suffix. 
  Since we haven't deployed the application as a .ear, 
  the app name for us will be an empty string
  */
          String appName = "";
  
          /* The module name is the JAR name of the deployed EJB 
          without the .jar suffix.
          */
          String moduleName = "HelloWorldSessionBean";
  
  /*AS7 allows each deployment to have an (optional) distinct name. 
  This can be an empty string if distinct name is not specified.
  */
          String distinctName = "";
  
          // The EJB bean implementation class name
          String beanName = HelloWorldBean.class.getSimpleName();
  
          // Fully qualified remote interface name
          final String interfaceName = HelloWorldRemoteBean.class.getName();
  
          // Create a look up string name
          String name = "ejb:" + appName + "/" + moduleName + "/" + 
              distinctName    + "/" + beanName + "!" + interfaceName;
  
          return name;
      }
  }
  </code></pre>
  
  <p>Output:connecting..</p>
  
  <p>I am not getting any ouput...
  JBOSS server is running and EJB is already deployed..
  Jbossall-client jar is imported..
  I am new to EJB...need help?
  There is no problem with the configuration either...</p>
  
  <p><strong>Wildfly log</strong></p>
  
  <pre><code>04:20:56,353 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
  04:20:56,648 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
  04:20:56,761 INFO  [org.jboss.as] (MSC service thread 1-2) JBAS015899: WildFly 8.2.1.Final "Tweek" starting
  04:20:58,794 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found HelloWorldSessionBean.jar in deployment directory. To trigger deployment create a file called HelloWorldSessionBean.jar.dodeploy
  04:20:58,795 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found EjbComponent.jar in deployment directory. To trigger deployment create a file called EjbComponent.jar.dodeploy
  04:20:58,828 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
  04:20:59,041 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.3.0.Final
  04:20:59,051 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.3.0.Final
  04:20:59,244 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.7.Final
  04:20:59,319 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
  04:20:59,552 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
  04:20:59,604 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.1.8.Final starting
  04:20:59,617 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
  04:20:59,703 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 4 core threads with 32 task threads based on your 2 available processors
  04:20:59,740 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
  04:20:59,745 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017502: Undertow 1.1.8.Final starting
  04:20:59,746 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013170: Current PicketBox version=4.0.21.Final
  04:20:59,761 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010417: Started Driver service with driver-name = h2
  04:20:59,790 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path C:\Jboss8.2.1\wildfly-8.2.1.Final/welcome-content
  04:20:59,851 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017525: Started server default-server.
  04:20:59,854 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017531: Host default-host starting
  04:20:59,861 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
  04:20:59,900 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
  04:20:59,946 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
  04:21:00,030 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
  04:21:00,462 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service
  04:21:00,471 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]
  04:21:00,502 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory C:\Jboss8.2.1\wildfly-8.2.1.Final\standalone\deployments
  04:21:00,502 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "EjbComponent.jar" (runtime-name: "EjbComponent.jar")
  04:21:00,506 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "HelloWorldSessionBean.jar" (runtime-name: "HelloWorldSessionBean.jar")
  04:21:00,856 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment EjbComponent.jar
  04:21:00,901 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017519: Undertow HTTP listener default listening on localhost/127.0.0.1:8080
  04:21:00,909 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment HelloWorldSessionBean.jar
  04:21:01,301 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-4) HV000001: Hibernate Validator 5.1.3.Final
  04:21:01,774 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named HelloWorldBean in deployment unit deployment "HelloWorldSessionBean.jar" are as follows:
  
      java:global/HelloWorldSessionBean/HelloWorldBean!com.jeet.org.HelloWorldBean
      java:app/HelloWorldSessionBean/HelloWorldBean!com.jeet.org.HelloWorldBean
      java:module/HelloWorldBean!com.jeet.org.HelloWorldBean
      java:global/HelloWorldSessionBean/HelloWorldBean!com.jeet.interfaces.HelloWorldRemoteBean
      java:app/HelloWorldSessionBean/HelloWorldBean!com.jeet.interfaces.HelloWorldRemoteBean
      java:module/HelloWorldBean!com.jeet.interfaces.HelloWorldRemoteBean
      java:jboss/exported/HelloWorldSessionBean/HelloWorldBean!com.jeet.interfaces.HelloWorldRemoteBean
  
  04:21:01,850 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named LibrarySessionBean in deployment unit deployment "EjbComponent.jar" are as follows:
  
      java:global/EjbComponent/LibrarySessionBean!com.jeet.org.LibrarySessionBeanRemote
      java:app/EjbComponent/LibrarySessionBean!com.jeet.org.LibrarySessionBeanRemote
      java:module/LibrarySessionBean!com.jeet.org.LibrarySessionBeanRemote
      java:jboss/exported/EjbComponent/LibrarySessionBean!com.jeet.org.LibrarySessionBeanRemote
      java:global/EjbComponent/LibrarySessionBean
      java:app/EjbComponent/LibrarySessionBean
      java:module/LibrarySessionBean
  
  04:21:01,907 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
  04:21:02,100 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
  04:21:02,217 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: EjbComponent.jar
  04:21:02,255 INFO  [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900: 2.2.6 (Final)
  04:21:02,326 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment EjbComponent.jar
  04:21:02,397 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016005: Starting Services for CDI deployment: HelloWorldSessionBean.jar
  04:21:02,474 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment HelloWorldSessionBean.jar
  04:21:03,859 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "HelloWorldSessionBean.jar" (runtime-name : "HelloWorldSessionBean.jar")
  04:21:03,859 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "EjbComponent.jar" (runtime-name : "EjbComponent.jar")
  04:21:04,017 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
  04:21:04,019 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
  04:21:04,019 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.1.Final "Tweek" started in 8101ms - Started 330 of 390 services (98 services are lazy, passive or on-demand)
  </code></pre>