3 Replies Latest reply on Feb 28, 2007 8:06 PM by persabi

    Declaring session beans in ejb-jar.xml

    persabi

      In the case where there exists an abstract base class with member level annotations and an inheriting subclass SFSB, a basic Seam app works fine where the @Stateful annotation exists in the inheriting subclass. In this case, the jboss logs show:

      Component: register, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: org.test.hotelbooking.RegisterActionBean, JNDI: booking-seam-1.0-SNAPSHOT/RegisterActionBean/local
      


      However, say instead of specifying the @Stateful annotation on the SFSB subclass, I define the session bean in the ejb-jar.xml like so:

      <session>
       <description>Register Action Bean</description>
       <ejb-name>RegisterActionBean</ejb-name>
       <local>org.test.hotelbooking.RegisterActionLocal</local>
       <ejb-class>org.test.hotelbooking.RegisterActionBean</ejb-class>
       <session-type>Stateful</session-type>
       <transaction-type>Container</transaction-type>
      </session>
      


      the bean is not registered as a SFSB Seam component, rather a javabean Seam component.

      Component: register, scope: EVENT, type: JAVA_BEAN, class: org.test.hotelbooking.RegisterActionBean, JNDI: booking-seam-1.0-SNAPSHOT/RegisterActionBean/local
      


      Bear in mind, instead of specifying the @Name and @Scope annotations on the bean (subclass), we define them in components.xml like so:

      <component
       name="register"
       class="org.test.hotelbooking.RegisterActionBean"
       scope="event"
       jndi-name="booking-seam-1.0-SNAPSHOT/RegisterActionBean/local"/>
      


      Any ideas how we can define these beans as SFSB rather than javabeans and avoid using the @Stateful in the bean subclass?

      Thanks