Hi Remon,
How does your web.xml (or the relevant configuration file) looks? While
back I had a similar problem when using jersey with Grizzly; When I made
sure the packages that contain the providers are passed to the servlet init,
it worked. Just a thought; you may have already tried this.
Also, check your war (or jar) file. See whether META-INF/services contain a
reference to the JSON provider. If not, then, there may be a problem in the
way you create the war/jar file.
- Geeth
On Mon, Oct 18, 2010 at 12:15 PM, Remon van Vliet [via Jersey] <
ml-node+5646792-1612323868-293298_at_n2.nabble.com<ml-node%2B5646792-1612323868-293298_at_n2.nabble.com>
> wrote:
> Hi,
>
> I have a GSON message writer and reader annotated as follows :
>
> @Provider
> @Singleton
> @Consumes(MediaType.APPLICATION_JSON)
> @Produces(MediaType.APPLICATION_JSON)
> public class GSONJSONProvider implements MessageBodyWriter<Object>,
> MessageBodyReader<Object> {
> ...
> }
>
> Now, when I deploy to GF3 Jersey does see it :
>
> INFO: Provider classes found:
> class com.exmachina.play2tv.commons.services.GSONJSONProvider
>
> But a bit later does not consider it an appropriate option as a JSON
> message writer :
>
> SEVERE: A message body writer for Java class
> com.exmachina.play2tv.service.config.dto.ServiceSettings, and Java type
> class com.exmachina.play2tv.service.config.dto.ServiceSettings, and MIME
> media type application/json was not found
> SEVERE: The registered message body writers compatible with the MIME media
> type are:
> application/json ->
> com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
> com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
> com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
> com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
> com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
> */* ->
> com.sun.jersey.core.impl.provider.entity.FormProvider
> com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
> com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
> com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
> com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
> com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
> com.sun.jersey.core.impl.provider.entity.StringProvider
> com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
> com.sun.jersey.core.impl.provider.entity.FileProvider
> com.sun.jersey.core.impl.provider.entity.InputStreamProvider
> com.sun.jersey.core.impl.provider.entity.DataSourceProvider
> com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
> com.sun.jersey.core.impl.provider.entity.ReaderProvider
> com.sun.jersey.core.impl.provider.entity.DocumentProvider
> com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
> com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
> com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
> com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
> com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
> com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
> com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
> com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
>
> Does anyone have any idea what i'm doing wrong. The problem occurs using
> Jersey 1.1.X as well as 1.4.
>
> Regards,
>
> Remon,
>
>
> ------------------------------
> View message @
> http://jersey.576304.n2.nabble.com/Jersey-does-not-pick-up-Provider-tp5646792p5646792.html
> To start a new topic under Jersey, email
> ml-node+576304-912394236-293298_at_n2.nabble.com<ml-node%2B576304-912394236-293298_at_n2.nabble.com>
> To unsubscribe from Jersey, click here<http://jersey.576304.n2.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=576304&code=Z2VldGguZGVtZWxAZ21haWwuY29tfDU3NjMwNHwtMTcxOTI0ODY2MQ==>.
>
>
>
--
Geeth Ranmal de Mel
Research Assistant
Department of Computing Science
University of Aberdeen
Aberdeen AB24 3UE
Scotland (UK)
Tele : +44 - 1224 - 274174
Fax : +44 - 1224 - 273422
Web : http://www.csd.abdn.ac.uk/~gdemel
--
View this message in context: http://jersey.576304.n2.nabble.com/Jersey-does-not-pick-up-Provider-tp5646792p5647229.html
Sent from the Jersey mailing list archive at Nabble.com.