Details

    • Type: Enhancement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.5.2.Final
    • Fix Version/s: None
    • Component/s: jaxrs
    • Labels:
      None

      Description

      While working on integrating RESTEasy into OpenLiberty, I found a test case that seems to fail for me - it involves `@Context` injection into a sub resource locator class.  For example:
      @Path("/hello")
      public class HelloController {
        @Context
        ResourceContext resouceContext;
       
        @Path("/init")
        public SubResource initResource() {
          return resouceContext.initResource(newSubResource());
      {{  }}}

        @Path("/get")
        public SubResource getResource() {
          return resouceContext.getResource(SubResource.class);
      {{  }}}
      }

       
      public class SubResource {
        @Context
        UriInfo uriInfo;
       
        @GET
        public String checkContextInjection() {
          return uriInfo == null ? "Failed" : "Worked";
      {{  }}}
      }

       
      In my local Open Liberty workspace, the first sub-resource method (initResource) works, but the second (getResource) fails - the injection of the UriInfo object does not occur.
       
      I created a reproducer app that runs on Wildfly 20.0.1, and in that app, both methods fail (uriInfo is null).  I'm not sure what version of RESTEasy is included in 20.0.1.
       
      My reproducer app is available at:
      https://github.com/andymc12/subresource-issue

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rsearls r searls
                Reporter:
                andymc12 Andy McCright
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: