3 Replies Latest reply on Jun 1, 2006 9:17 PM by bdecoste

    ApplicationException in ejb-jar.xml

    jc7442

      I try to specify that an exception is an application exception using ejb-jar.xml. I wrote:

      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar>
       <description>Sample</description>
       <display-name>Sample</display-name>
       <application-exception>
       <exception-class>mypackage.OptimisticVerificationException</exception-class>
       <rollback>false</rollback>
       </application-exception>
      </ejb-jar>
      


      Unfortunatelly JBoss embeddable EJB3 rc6 seems to ignore exception definition. Any idea of what's going wrong in my XML ?

      I have try to use annotation, it works fine. Unfortunatelly for some of the exception I can not change source code. I need to define exception as application exception out of the source code.

        • 1. Re: ApplicationException in ejb-jar.xml
          bdecoste

          The <application-exception> element needs to be a child of the <assembly-descriptor> element. Please see the ejb-jar_3_0.xsd schema.

          • 2. Re: ApplicationException in ejb-jar.xml
            jc7442

            With the assembly descriptor tag it still not works:

            <?xml version="1.0" encoding="UTF-8"?>
            <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">
            
             <description>Sample</description>
             <display-name>Sample</display-name>
             <assembly-descriptor>
             <application-exception>
             <exception-class>mypackage.OptimisticVerificationException</exception-class>
             <rollback>false</rollback>
             </application-exception>
             </assembly-descriptor>
            </ejb-jar>
            


            It looks to be compliant with the schema but it is ignored by embeddable jboss ejb3.

            • 3. Re: ApplicationException in ejb-jar.xml
              bdecoste

              I've opened a JIRA task for this issue. Thanks.

              http://jira.jboss.com/jira/browse/EJBTHREE-611