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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • 3.11.1.Final, 4.5.3.Final
    • 3.12.0.Final, 4.5.5.Final
    • None
    • None
    • 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`.

      Attachments

        Issue Links

          Activity

            People

              rsearls r searls
              tobi.erdle@gmail.com Tobias Erdle (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: