Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-965

http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.7.0
    • 3.1.2
    • webservices
    • None
    • All

    Description

      As this problem becomes critical for applications, I have decided to open a JIRA.
      The full description is available at http://www.nabble.com/exceptions-handling-with-Webservices-td19668275.html

      Here are some thoughts.

      In the intercept method of the EjbInterceptor class (openejb-cxf module), we can either directly call the target EJB bean (when no handler has been defined) or delegate to the CXF chain when handlers have been defined.

      Regarding the first case, when an ApplicationException is thrown. This exception is caught by the preEjbInvoke method (from the EjbMethodInvoker). The preEjbInvoke method registers all exceptions as UNCHECKED so the client always receives a SOAPFaultException instead of the user defined application exception.

      We can work around this problem by adding a dummy handler or change the test to be sure it's always false.

      line 82: if (binding.getHandlerChain() == null || binding.getHandlerChain().isEmpty()) {
      

      To conclude, invoking directly the target EJB bean does not handle exceptions correctly.

      Attachments

        1. patch-openejb-965.txt
          4 kB
          Jean-Louis Monteiro

        Activity

          People

            jlmonteiro Jean-Louis Monteiro
            jlmonteiro Jean-Louis Monteiro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: