3 Replies Latest reply on Nov 8, 2006 12:44 PM by Martin Ekstrom

    Integrating Seam with EJB container

    Martin Ekstrom Newbie

      Hi

      I have two modules, a web-module and an ejb-module. In the web-module I have some @Stateless annotated Action classes. In the ejb-module I have a number of stateless session beans etc. I also have a j2ee-module that used for deployment.

      The problem is that JBOSS finds and registers/starts my ejb's that resides under the ejb-module, but not those actions that resides under web-module. How do I tell JBoss to look for @Stateless under the web-module as well.

      In the ejb-module (under meta-inf), I have ejb-jar.xml, persistendce.xml etc.

      My ejb jar looks like the following:
      <ejb-jar 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/ejb-jar_3_0.xsd"
      version="3.0">



      <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>



      <assembly-descriptor>
      <interceptor-binding>
      <ejb-name>*</ejb-name>
      <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
      </interceptor-binding>
      </assembly-descriptor>

      </ejb-jar>



      In the web-module (under web-inf), I have components.xml, faces-config.xml, web.xml etc.

      components.xml:



      true
      #{ejbName}/local



      <!-- half second wait for conversation lock on concurrent requests -->
      500
      <!-- 120 second conversation timeout -->
      120000
      cid
      clr


      <!--

      /main.xhtml

      -->





      faces-config.xml:

      <faces-config>
      <!-- Phase listener needed for all Seam applications -->


      <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>


      </faces-config>



      web.xml:

      <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">

      <!-- Seam -->


      <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>


      <!-- MyFaces -->


      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>


      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
      </context-param>

      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</param-value>
      </context-param>


      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>


      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.seam</url-pattern>
      </servlet-mapping>

      <!-- JSP -->
      <jsp-config>
      <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <is-xml>true</is-xml>
      </jsp-property-group>
      </jsp-config>

      </web-app>



      In j2ee-application-module, under meta-inf, I have the application.xml which contains:

      <display-name>Ratten</display-name>

      RattenBusiness.jar



      <web-uri>RattenWeb.war</web-uri>
      <context-root>/</context-root>





      I also have an empty jboss-app.xml.