1 Reply Latest reply on Jun 3, 2004 6:02 PM by Adrian Brock

    javax.ejb.EJBException: nested exception is: javax.naming.No

    satheesh_79 Newbie

      Hi i am satheesh working in jboss 3.2.3 with embedded tomcat 4.0.
      I can able to work with ejb from jsp .
      but one of my application wants that my java class should be the client program for EJB.In which I declared as:
      java.util.Hashtable props = new java.util.Hashtable();
      props.put(javax.naming.InitialContext.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      props.put(javax.naming.InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");
      javax.naming.InitialContext ctx = new javax.naming.InitialContext(props);
      Object obj = ctx.lookup( "POEBBean" );

      POEBHome home=(POEBHome)javax.rmi.PortableRemoteObject.narrow(obj,POEBHome.class);
      POEB myposb= home.create(PONUMBER,POSITIONNUMBER,CUSTOMERID,SUPPLIERID,QUANTITY,UNIT,ITEMID,STARTDATE,DELIVERYDATE,STATUS,PRICE,CURRENCY);


      I want to lookup the entity bean from the session bean.
      The session bean will inturn call the java class (i.e) this program which is looking up entity bean to insert into the table(by means of ejbcreate).
      I am getting :


      javax.ejb.EJBException: nested exception is: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory

      Errror .
      I I lookup from jsp it is working.Why shouldn;t the java class is not working.

      Pls reply me soon because I have to complete the project by tomorrow.