Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-462

assembly-descriptor required to get proper SFSB remove-method behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EJB 3.0 RC6 - PFD
    • EJB 3.0 RC5 - PFD
    • None
    • None
    • Interactive Demo/Tutorial, Compatibility/Configuration

      Based on experimentation with the RC5 stateful_deployment_descriptor tutorial, I have determined the following:

      The absence of <assembly-descriptor/> in ejb-jar.xml causes the remove-method to not take effect, meaning calls to the bean after invoking the method designated as the remove-method do not throw EJBNoSuchObjectException (or any other Exception, for that matter).

      If <assembly-descriptor/> is present, we get proper behavior. Problem is, assembly-descriptor is not a required element.

      I have seen this behavior consistent with both the RC5 stateful_deployment_descriptor tutorial, running it as-is, as well as with my own example based on it, in which I have reflected the current XMLSchema definition of remove-method in my ejb-jar.xml file. That is:

      <code>
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- from the tutorial -->
      <ejb-jar version="3.0">
      <description>JBoss Stateful Session Bean Tutorial</description>
      <display-name>JBoss Stateful Session Bean Tutorial</display-name>
      <enterprise-beans>
      <session>
      <ejb-name>ShoppingCart</ejb-name>
      <remote>org.jboss.tutorial.stateful_deployment_descriptor.bean.ShoppingCart</remote>
      <ejb-class>org.jboss.tutorial.stateful_deployment_descriptor.bean.ShoppingCartBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type>
      <remove-method>
      <bean-method>
      <method-name>checkout</method-name>
      </bean-method>
      </remove-method>
      </session>
      </enterprise-beans>
      <!--
      <assembly-descriptor>
      </assembly-descriptor> -->
      </ejb-jar>
      </code>

      yields the same behavior as:

      <code>
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- using the current XMLSchema definition, which deploys fine (and is XMLSchema valid) -->
      <ejb-jar version="3.0"
      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">

      <enterprise-beans>
      <session>
      <ejb-name>ShoppingCart</ejb-name>
      <remote>org.jboss.tutorial.stateful_deployment_descriptor.bean.ShoppingCart</remote>
      <ejb-class>org.jboss.tutorial.stateful_deployment_descriptor.bean.ShoppingCartBean</ejb-class>
      <session-type>Stateful</session-type>
      <remove-method>
      <bean-method>
      <method-name>checkout</method-name>
      </bean-method>
      <retain-if-exception>false</retain-if-exception>
      </remove-method>
      <transaction-type>Container</transaction-type>
      </session>
      </enterprise-beans>

      <!-assembly-descriptor/->

      </ejb-jar>
      </code>

              wdecoste1@redhat.com William Decoste (Inactive)
              jrostosk_jira Jay Rostosky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: