Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.7.6
-
None
-
Unknown
Description
I'm unable to use a @BeanParam in subresource without specifying the bean parameter in the first method call as a method parameter in the resource call chain. In pseudo code:
class Bean {
@QueryParam("name")
private String name;
... getters/setters
}
@Path("/")
@Produces(MediaType.PLAIN_TEXT)
class Root {
@Context private ResourceContext resources;
@GET public String get()
{ return "/hello"; } @Path("hello")
public HelloResource hello()
}
class HelloResource {
@BeanParam
private Bean params;
@GET
public String get()
}
This fails with an exception in JAXRSUtils.java line 1000 or so. Changing Root#hello's signature to:
@Path("hello")
public HelloResource hello(@SuppressWarnings("unused") @BeanParam Bean param) {
}
makes the exception go away and has the Bean injected into HelloResource.
In my opinion this should not be necessary, and indeed, Jersey and RestEasy both work support this construct without having to resort to introducing unused parameters.
I've attached a quickstart that shows the problem.