3 Replies Latest reply on Oct 29, 2006 1:09 PM by darren chen

    how to call the session bean after deployed

    darren chen Newbie

      hi, i have deployed a sample session bean into jboss as, (java:comp namespace of the JSP.war application:) . the deployment is successfull.

      but i having problem to call it for testing. the structure is:

      Project: JSP
      Package: bean
      files: Hello.java, HelloBean.java, HelloHome.java, HelloLocal.java, HelloLocalHome.java,

      I calling from HelloClient.java , coding as follow:

      Properties props = System.getProperties();
      Context ctx = new InitialContext(props);
      Object obj = ctx.lookup("HelloBean");

      and i have this error msg: 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

      what's the right name i should lookup? I have made this file under "META-INF" folder:
      <!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>

      <ejb-name>HelloBean</ejb-name>
      bean.HelloHome
      bean.Hello
      <local-home>bean.HelloLocalHome</local-home>
      bean.HelloLocal
      <ejb-class>bean.HelloBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>
      </ejb-jar>

      can anyone answer my question. thanks alot