0 Replies Latest reply on Feb 21, 2012 2:34 AM by riyuezhizhi

    JBOSS AS 5.0:EJBDaoImpl NOT BOUND

    riyuezhizhi

      Hi :

         I had

       

      deployed a simple EJB project on JBoss AS 5.0, but it throw exception:EJBDaoImpl NOT BOUND

       

      There are my project content:

       

       

         

      package domain;

       

      public interface EJBDAO {

      public String sayHello (String name) ;

      }

       

       

       

      package domain;

       

      import javax.ejb.Remote;

      import javax.ejb.Stateless;

       

      @Stateless

      @Remote(EJBDAO.class)

      public class EJBDaoImpl implements EJBDAO {

       

      public String sayHello(String name) {

       

      return name;

      }

       

      }

       

       

       

      web.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app version="2.5" 

      xmlns="http://java.sun.com/xml/ns/javaee

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 

      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

        <welcome-file-list>

        <welcome-file>index.jsp</welcome-file>

        </welcome-file-list>

        <description>ejb3.0testwebsite</description>

      </web-app>

      jsp页面:

      <%@ page contentType="text/html;charset=GBK" %>

      <%@ page import="domain.EJBDAO,javax.naming.*,java.util.Properties" %>

      <%

        try {

        InitialContext ctx = new InitialContext ();

        EJBDAO dao = (EJBDAO) ctx.lookup("EJBDaoImpl/remote");

        out.print(dao.sayHello("<h3 align=center>Hello everyone</center>"));

        } catch (Exception e) {

        out.print(e.getMessage());

        throw e;

        } %>

       

      over

       

      This project is a web project and maybe i should new an ejb project ? and how should i do?

       

      If you can give me an example project i would appreciated and this is my Email address:riyuezhizhi@163.com.

       

      Thanks for you pay attention to the article.