Hello, I can't access my EJB from a JSP...

Here is the code ofg the JSP page where I access the bean :

    <%@ taglib uri="ejbtags" prefix="ejb" %>
    <%
     if(session.getAttribute("brain") == null) { %>
     <ejb:useHome id="home" type="ubiquity.dbsg3.ejb.JSPBrainHome"
location="java:comp/env/brain" />
     <% session.setAttribute("brain", home.create());
    }
    %>

    <jsp:useBean id="brain" type="ubiquity.dbsg3.ejb.JSPBrain"
scope="session" />


Here is the lines where I declare my EJB in /WEB-INF/ejb-jar.xml :

    <enterprise-beans>
      <session>
       <description>Helpful EJB for JSP from DBSG3</description>
       <display-name>brain</display-name>
       <ejb-name>brain</ejb-name>
       <home>ubiquity.dbsg3.ejb.JSPBrainHome</home>
       <remote>ubiquity.dbsg3.ejb.JSPBrain</remote>
       <ejb-class>ubiquity.dbsg3.ejb.JSPBrainEJB</ejb-class>
       <session-type>Stateful</session-type>
       <transaction-type>Container</transaction-type>
      </session>
     </enterprise-beans>


Here is my the lines where I declare the taglib and my ejb in
WEB-INF/web.xml

    <taglib>
      <taglib-uri>ejbtags</taglib-uri>
      <taglib-location>/WEB-INF/lib/ejbtags.jar</taglib-location>
     </taglib>
        <ejb-ref>
      <ejb-ref-name>brain</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <home>ubiquity.dbsg3.ejb.JSPBrainHome</home>
      <remote>ubiquity.dbsg3.ejb.JSPBrain</remote>
     </ejb-ref>

When I launch Orion, my application deploy correctly but when I try to
access my JSP page here is the exception that occures :

    500 Internal Server Error

    javax.servlet.jsp.JspException: NamingException: Error instantiating
web-app JDNI-context: No location specified and no     suitable instance of
the type 'ubiquity.dbsg3.ejb.JSPBrain' found for the ejb-ref brain
            at
com.evermind.ejb.taglib.UseHomeTag.doStartTag(UseHomeTag.java:36)
            at __jspPage0._jspService(__jspPage0.java:44)
            at com.evermind.server.http.EvermindHttpJspPage.service(JAX)
            at com.evermind.server.http.HttpApplication.pk(JAX)
            at com.evermind.server.http.JSPServlet.service(JAX)
            at com.evermind.server.http.c1.l_(JAX)
            at com.evermind.server.http.c1.forward(JAX)
            at com.evermind.server.http.dc.ca(JAX, Compiled Code)
            at com.evermind.util.b.run(JAX, Compiled Code)



I don't know what is wrong...

Thanks to help me

Laurent CORNELIS


Reply via email to