[Jersey] Accessing (remote) request URI in Provider

From: Martynas Jusevicius <>
Date: Tue, 14 Feb 2012 13:14:53 +0100


I have a MessageBodyReader that reads RDF Model. I use it on remote
WebResources like this:

            Model m = Client.create(config).

How can I access the request URI (in this case filenameOrURI) within
the MessageBodyReader?
It is necessary to provide a base URI when reading RDF (in case it
contains any relative URIs).

I tried injecting @Context UriInfo uriInfo but this failed:

SEVERE: The following errors and warnings have been detected with
resource and/or provider classes:
  SEVERE: Missing dependency for field: private org.graphity.provider.ModelProvider.uriInfo