I\'m trying to get the JSR-311 plugin working with Grails 2.3.7. I\'m using version 0.10, because I think 0.11 requires Grails 2.4.
I\'ve used the generate-resourc
I have no experience in Grails whatsoever, but from a pure Jersey standpoint, look at what you got here
@Path('{id}')
@GET
ProductResource getResource(@PathParam('id') Long id) {
This is resource method (endpoint). So the ProductsResource will be treated as the response body, just like any other resource method.
You seem to be trying to use the sub-resource locator functionality, forwarding to the ProductsResource class. For that to work, the sub-resource locator (getResource) should not have an @HttpMethod annotation. That's one of the factors that differentiates a resource method from a sub-resource locator.
So just remove the @GET from the getResource method. The @GET is already established by the read() method in the ProductsResource, which is what will be called.