Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2391

ResourceInfo provides super-class method instead of sub-class method in inherited JAX-RS controller

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.11.1.Final, 4.5.3.Final
    • Fix Version/s: 3.12.0.Final, 4.5.5.Final
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide
      • Clone / Fork: https://github.com/erdlet/krazo
      • Check out the branch `resteasy-issue-example`
      • Build the `core` module as SNAPSHOT with `mvn clean install`
      • Run `mvn clean verify -Ptestsuite-wildfly -Dit.test=AnnotationsIT#testNoOverrideMvc` in `testsuite` module
      • The test fails, as Status `200` is returned instead of `500`
      Show
      Clone / Fork: https://github.com/erdlet/krazo Check out the branch `resteasy-issue-example` Build the `core` module as SNAPSHOT with `mvn clean install` Run `mvn clean verify -Ptestsuite-wildfly -Dit.test=AnnotationsIT#testNoOverrideMvc` in `testsuite` module The test fails, as Status `200` is returned instead of `500`

      Description

      I'm working on Eclipse Krazo, the RI for JSR 371. During development, we recognized that RESTEasy shows a different behavior than other JAX-RS implementations on inherited controllers (https://github.com/eclipse-ee4j/krazo/issues/29). This leads to a not working inheritance check on MVC controllers in

      org.eclipse.krazo.core.ViewResponseFilter#filter
      

      , where we access

      ResourceInfo#getResourceMethod
      

      and

      ResourceInfo#getResourceClass
      

      After a lot of debugging we figured out that the `ResourceInfo`, which is provided by RESTEasy, doesn't contain the sub-class method

      org.eclipse.krazo.test.annotations.AnnotationsController#methodNoOverrideMvc
      

      which is really invoked by the client. Instead, we receive the base class method

      org.eclipse.krazo.test.annotations.BaseController#methodNoOverrideMvc
      

      on which the inheritance checks fail, because nothing is inherited there:

      2019-10-23 18:11:41,215 FINE  [org.eclipse.krazo.test.annotations.AnnotationsController] (default task-1) Executing AnnotationsController#methodNoOverrideMvc
      
      2019-10-23 18:11:41,215 FINE  [org.eclipse.krazo.core.ViewResponseFilter] (default task-1) Filter response for controller: org.eclipse.krazo.test.annotations.BaseController#methodNoOverrideMvc
      

      Because the `ResourceInfo` JavaDoc says it is

      An injectable class to access the resource class and resource method matched by the current request

      , the described behavior seems like a bug to us, as the really requested method is not accessible by the `ResourceInfo`.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rsearls r searls
                Reporter:
                erdlet Tobias Erdle
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: