0 Replies Latest reply on Jul 10, 2002 3:59 PM by ejbclinic

    NameNotFoundException only in local interface

    ejbclinic

      Well i am developing simple local cmp bean.It is deploying but it is giving exception only case of local interface.
      javax.naming.NameNotFoundException: CustomerHome not bound.
      My ejb-jar is
      ////////////////////////////////////////////////
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>
      <enterprise-beans>
      <!--CUSTOMER EJB-->

      <ejb-name>CustomerEJB</ejb-name>
      <local-home>com.ssuet.customer.CustomerHome</local-home>
      com.ssuet.customer.Customer
      <ejb-class>com.ssuet.customer.CustomerBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Customer</abstract-schema-name>

      <cmp-field>
      <field-name>userID</field-name>
      </cmp-field>

      <cmp-field>
      <field-name>userPwd</field-name>
      </cmp-field>

      <primkey-field>userID</primkey-field>
      <security-identity><use-caller-identity/></security-identity>


      </enterprise-beans>

      </ejb-jar>
      /////////////////////////////////////////////////
      My java client is.

      import javax.ejb.*;
      import javax.naming.*;
      import java.util.*;
      import com.ssuet.customer.*;
      import javax.rmi.PortableRemoteObject ;

      public class CustomerClient
      {
      public static void main(String args[])
      {
      Customer cus=null;
      try {
      InitialContext ic = new InitialContext();

      CustomerHome cm=(CustomerHome)ic.lookup("CustomerEJB");
      //CustomerHome cm=(CustomerHome)PortableRemoteObject.narrow(obj,CustomerHome.class);

      System.out.println("Got Jndi Ref..");

      //cus=cm.create("1","Street");
      //cus.setAddress("1","Street5","Karachi");

      }
      catch(Exception e){
      e.printStackTrace();
      }
      }
      }

      Thanks for help.