title: Error while running client code in EJB
body: <p>Getting error while running client code in EJB:</p>
  
  <blockquote>
    <p>Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
    weblogic/kernel/KernelStatus  at
    weblogic.jndi.Environment.(Environment.java:78)   at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
      at
    javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
      at
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      at javax.naming.InitialContext.init(InitialContext.java:223)    at
    javax.naming.InitialContext.(InitialContext.java:197)   at
    User.main(User.java:21)</p>
  </blockquote>
  
  <p>I added <code>wlfullclient.jar</code>, server's Remote interface jar, also I saw article in which I saw to add <code>wlclient.jar</code> and <code>weblogic.jar</code> but then also got same error.</p>
  
  <p>Help highly appreciated.</p>
  
  <p>Client code:</p>
  
  <pre><code>import com.amdocs.Stateful.*;
  import java.util.Hashtable;
  import javax.naming.InitialContext;
  import javax.naming.NamingException;
  
  public class User 
  {
  public static void main(String args[]){
  Hashtable&lt;String,String&gt; ht = new Hashtable&lt;String,String&gt;();
  
  ht.put(InitialContext.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");// you have to start from root location to search for JNDI tree
  //JNDI registry tree is normally maintained as Binary tree, JNDi is normally binary tree which have root node at top
  
  ht.put(InitialContext.PROVIDER_URL,"t3://localhost:7001"); // address of registry
  try{
      System.out.println("Hello");
      InitialContext ic = new InitialContext(ht); // start searching wrt what we set in ht , it's constructor takes HashTable only
  
      System.out.println("Hello2");
      MyCartRemote ref=(MyCartRemote)ic.lookup("MyCartBeanJNDI#com.amdocs.Stateful.MyCartRemote");
      ref.add("Hi");
      ref.add("Jeetendra");
  
      MyCartRemote ref1=(MyCartRemote)ic.lookup("MyCartBeanJNDI#com.amdocs.Stateful.MyCartRemote");
      ref1.add("Hi");
      ref1.add("Subhash");
      ref1.add("Ghai");
  
      System.out.println("Object 1 data: "+ref.show());
      System.out.println("Object 2 data: "+ref1.show());
  }
  catch (NamingException e){      e.printStackTrace();    }
  }
  }
  </code></pre>