2 Replies Latest reply on Jun 5, 2009 1:01 AM by bingozzz bingozzz

    Jsp call EJB3.0

    Thuc Hoang Phuong Newbie

      Hi all,
      I'm learning EJB3.0 and Jboss4.0.5, Jbuilder2008. When I lookup EJB in jsp file, I receive error:
      javax.naming.NameNotFoundException: Name SessionBean is not bound in this Context
      at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
      at org.apache.naming.NamingContext.lookup(NamingContext.java:153)

      I lookup:

      try{
      Context context = new InitialContext(System.getProperties());
      String name="SessionBean/remote";
      ISessionBeanRemote bean=(ISessionBeanRemote)context.lookup(name);

      System.out.println(" Display Message Using EJB");
      System.out.println(" name : "+ bean.GetName("abc"));

      }
      catch(NamingException e){
      e.printStackTrace();
      }
      SessionBean is ejbName is deployed by Jboss4.0.5.
      I spent more time for fix bug but not complete. So can You help me.

      Thanks very much.
      ThucHP