users@jersey.java.net

[Jersey] Re: jackson-mapper dependency

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Mon, 10 Sep 2012 15:51:53 +0200

Hello Duncan,

looks like this is a problem with jackson-mapper-asl.jar. I'm not sure
why, but its manifest contains:

""
Private-Package: org.codehaus.jackson.map.ext
""

and org.codehaus.jackson.map.ext is not in "Export-package" header. So
you can file an issue or ask for opinion on jackson mailing list, we
can't do much more. Adding jackson-mapper jar into your war seems to be
acceptable workaround.

Regards,
Pavel

On 9/2/12 1:26 PM, Duncan Bloem wrote:
> Hello,
>
> When I
> use @JsonSerialize(using=JodaSerializers.DateTimeSerializer.class)
> within my entity, I have to include jackson-mapper.jar in the war,
> otherwise I receive the following error:
> java.lang.TypeNotPresentException: Type
> org.codehaus.jackson.map.ext.JodaSerializers$DateTimeSerializer not
> present
> ...
> java.lang.ClassNotFoundException:
> org.codehaus.jackson.map.ext.JodaSerializers$DateTimeSerializer
>
> Although the jackson-mapper.jar is packaged within the modules
> directory of Glassfish, it is not on the classpath it seems.
>
> Is there any solution to prevent this CNFE without including it in the
> war?
>
> Thanks,
> Duncan