Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7473

ExceptionMapper class hierarchies: incompatible ExceptionMapper selected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.11, 3.1.12
    • 3.2.2, 3.1.15
    • JAX-RS
    • None
    • Unknown

    Description

      CXF seems to select an incompatible ExceptionMapper when using class hierarchies.

      More precisely, if I define an abstract exception class like following:

      @Provider
      public abstract class AbstractExceptionMapper<E extends Throwable> implements ExceptionMapper<E> {
      ...
      

      Then I define a concrete one for IllegalArgumentExceptions:

      public class IllegalArgumentExceptionMapper extends AbstractExceptionMapper<IllegalArgumentException> {
      ...
      

      IllegalArgumentExceptionMapper will then be selected even for RuntimeException subtypes unrelated to IllegalArgumentExceptions.

      See minimal project showing the problem here

      Similar (if not same) problem seems to have been reported via CXF-6635, but I do see this with 3.1.11 and 3.1.12.

      Thx!

      Attachments

        Issue Links

          Activity

            People

              sergey_beryozkin Sergey Beryozkin
              jlepage-appdirect Jocelyn Lepage
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: