Re: [Jersey] Provider not getting detected properly

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Tue, 02 Feb 2010 10:31:27 +0100

Hi Chris,

i believe this is related to the issue [1],
could you please try to change the dependency
definition in your pom to use only the jersey-bundle
module instead of the individual jersey modules and re-try?

Does it work?



On Mon, Feb 01, 2010 at 05:31:07PM -0800, Chris Carrier wrote:
> OK so I have a very strange problem that I don't have a good solution
> for so I'm hoping someone can shed some light on it. I'm creating
> JSON services and letting JAXB handle the marshalling. This works
> fine when I run my code via my IDE (IntelliJ). It runs the code
> directly via my main() method. The problem is when I package the code
> into a jar and try to run on the command line I get an error:
> SEVERE: A message body writer for Java type, class com.some.Class, and
> MIME media type, application/json, was not found
> This is 100% consistent. I run in the IDE and it works then I try
> with the JAR and it explodes. I added a log line like this:
> ps.getMessageBodyWriter(RedirectLinkCollection.class, null, null,
> And sure enough in the IDE it prints:
> PROVIDERS com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App_at_1925d92
> While from the JAR it prints:
> Any ideas? I'm bundling all dependencies directly into my JAR and I
> can attest to the fact that the class is in there. I can work around
> this by writing my own JSON writer but I would rather leverage the
> JAXB automagic stuff.
> Chris
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail: