Details
-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
4.5.2.Final
-
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