Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-19429

Default ExceptionMapper cannot be disabled by setting "dev.resteasy.exception.mapper" to false through <context-param> in web.xml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • REST
    • None
    • ---
    • ---

      As described in the RESTEasy document - 32.1. Exception Mappers, the default ExceptionMapper is enabled since RESTEasy 6.1.0+ by RESTEASY-3097, and it can be turned off by setting the "dev.resteasy.exception.mapper" to false since RESTEasy 6.2.0+ by RESTEASY-3225.

      Setting the "dev.resteasy.exception.mapper" to false through the system property (= adding -Ddev.resteasy.exception.mapper=false as JVM option) works fine without RESTEasy MicroProfile, but setting the "dev.resteasy.exception.mapper" to false through <context-param> in web.xml (like the following) does not work without RESTEasy MicroProfile.

      <web-app>
          <context-param>
              <param-name>dev.resteasy.exception.mapper</param-name>
              <param-value>false</param-value>
          </context-param>
      </web-app>
      

      As far as I checked the RESTEasy document - 3.4. Configuration, it says:

      If MicroProfile Config is not available, then an attempt is made to retrieve the parameter from the following sources in this order:

      1. system variables, followed by
      2. environment variables, followed by
      3. web.xml parameters, as described in Section 3.4.5, "RESTEasy's classic configuration mechanism"

      Therefore, I think that <context-param> in web.xml should work even if MicroProfile Config is not available.

              jperkins-rhn James Perkins
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: