9 Replies Latest reply on Aug 10, 2007 1:28 PM by Samuel Doyle

    EJB 3.0 Seam Component Not Found

    birwin Newbie

      I have an EJB 3.0 Stateful Session Bean that I am unable to see from my web page (JSP at the moment). From the log files it is apparent the bean is not being detected by the seam deployment scanner.

      My EJB:

      @Stateful
      @Scope(CONVERSATION)
      @Name("divisionListener")
      public class DivisionListenerBean implements DivisionListener
      {
       @PersistenceContext (unitName="spike")
       private EntityManager em;
      
       @Logger
       private Log log;
      
       private int clientID = 5133;
      
       public void setClientID(int clientID)
       {
       this.clientID = clientID;
       }
      
       public int getClientID()
       {
       return this.clientID;
       }
      
      }



      My ejb-jar.xml file:
      <ejb-jar>
       <interceptors>
       <interceptor>
       <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
       </interceptor>
       </interceptors>
       <assembly-descriptor>
       <interceptor-binding>
       <ejb-name>*</ejb-name>
       <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
       </interceptor-binding>
       </assembly-descriptor>
      </ejb-jar>





      On the web client:
      my web.xml:
      <web-app>
       <!-- Listeners -->
       <listener>
       <!-- Seam -->
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
       <listener>
       <!-- JSF -->
       <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
       </listener>
       <!-- Faces Servlet -->
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>/faces/*</url-pattern>
       </servlet-mapping>
       <taglib>
       <taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
       <taglib-location>/WEB-INF/jsf_core.tld</taglib-location>
       </taglib>
       <taglib>
       <taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
       <taglib-location>/WEB-INF/html_basic.tld</taglib-location>
       </taglib>
       <taglib>
       <taglib-uri>http://java.sun.com/jsp/jstl/core </taglib-uri>
       <taglib-location>/WEB-INF/c.tld</taglib-location>
       </taglib>
       <context-param>
       <param-name>org.jboss.seam.core.init.jndiPattern</param-name>
       <param-value>/spike-ear-0.1.0/#{ejbName}/local</param-value>
       </context-param>
      </web-app>


      My Faces-Config file:
      <faces-config>
      
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
       </lifecycle>
      </faces-config>


      My Components.xml file:
      <components xmlns="http://jboss.com/products/seam/components"
       xmlns:core="http://jboss.com/products/seam/core">
       <core:init jndi-name="spike-ear-0.1.0/#{ejbName}/local" />
      </components>



      My JSP file:
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      
      <html>
       <head>
       <title>SOS Trax</title>
       <link href="../../css/trax.css" rel="stylesheet" type="text/css" />
       </head>
       <body>
       <h2>Payroll Export Parameters</h2>
       <f:view>
       <h:form>
       <h:inputText value="#{divisionListener.clientID}" />
       </h:form>
       </f:view>
       </body>
      </html>


      My log file indicates the EJB is not detected and deployed and when I hit the JSP I get this in my log file:
      DEBUG [org.jboss.seam.Component] seam component not found: divisionListener


      I have verified that my EJB is available as an ejb with the JNDI name: "spike-ear-0.1.0/DivisionListenerBean/local". This is displayed in my Global JNDI Namespace section of the JBoss JMX Console. I also wrote an application that used this EJB as a plain EJB and I had no problems.

      Any ideas what I have done wrong?