title: Wildfly 8 - ejb client issues
body: <p>I am following a tutorial and:</p>
  
  <p>deployed one ejb to Wildfly 8 -> checked</p>
  
  <p>Wildfly returns this when deploy ejb:</p>
  
  <pre><code>java:global/ejb/EmployeeManagementServiceImpl!staffmanagement.EmployeeManagementService
  java:app/ejb/EmployeeManagementServiceImpl!staffmanagement.EmployeeManagementService
  java:module/EmployeeManagementServiceImpl!staffmanagement.EmployeeManagementService
  java:jboss/exported/ejb/EmployeeManagementServiceImpl!staffmanagement.EmployeeManagementService
  java:global/ejb/EmployeeManagementServiceImpl
  java:app/ejb/EmployeeManagementServiceImpl
  java:module/EmployeeManagementServiceImpl
  </code></pre>
  
  <p>My client attempt:</p>
  
  <pre><code>public class ClientApplicationTest {
  
  public static void main( String[] args ) {
      System.out.println( "Hello World ClientApplicationTest!" );
      try {
          Context jndi = new InitialContext();
          String name = "java:module/EmployeeManagementServiceImpl";
          EmployeeManagementService service = (EmployeeManagementService) jndi.lookup(name);
  
          List&lt;Employee&gt; employees = service.getAllEmployees();
          for(Employee employee :employees ) {
              System.out.println(employee);
          }
      } catch (NamingException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
  at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
  at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
  at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:344)
  at javax.naming.InitialContext.lookup(InitialContext.java:411)
  at j2ee.staffmanagement.client.ClientApplicationTest.main(ClientApplicationTest.java:25)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  </code></pre>
  
  <p>I added following library to the client (besides ejb itself):
  /Library/WildFly/modules/system/layers/base/org/jboss/as/appclient/main/wildfly-appclient-8.1.0.Final.jar (COMPILE SCOPE)</p>
  
  <p>Honestly not sure what is wrong: jndi name, or because I am calling remote EJB from outside container, need something else.</p>
  
  <p>PS: EJB is deployed fine</p>
  
  <p>Any inputs pls?</p>
  
  <p>Tnx</p>