users@jersey.java.net

[Jersey] Re: can not unmarshal nested generic list in a wrapper

From: rocklee <minitip_at_gmail.com>
Date: Fri, 4 Mar 2011 18:50:46 -0800 (PST)

Hi Jakub,

Thanks a lot for your help. The app works well now. I'm using spring with
jersey, so I just added the @Component annotation.

@Component
@Provider
public class JacksonObjectMapperProvider implements ContextResolver {

    @Override
    public ObjectMapper getContext(Class<?> type) {
        return new ObjectMapper().configure(Feature.USE_ANNOTATIONS, false);
    }

}

Best Regards,
Lee


Jakub Podlesak-2 wrote:
>
> Hi Lee,
>
> I apologize for the late reply.
>
> You will need to tell Jackson
> to ignore annotations.
>
> You can just add Jackson ObjectMapper provider (see attached),
> and make Jersey aware of it by adding an extra ServletFilter param:
>
>
> com.sun.jersey.config.property.packages
> com.demo.util
>
>
> Does it work for you now?
>
> ~Jakub
>
> On 02/22/2011 02:52 AM, rocklee wrote:
>> Hi Jakub,
>>
>> Thanks a lot for your help. I tried to enable POJO_MAPPING feature and
>> use
>> the 3rd annotation, but the json format is still the same, and when
>> unmarshal the response, only one object returned. By the way, I'm using
>> version 1.5, I tried version 1.4, no object can be unmarshalled.
>> http://jersey.576304.n2.nabble.com/file/n6050889/jersey-generic-test.zip
>> jersey-generic-test.zip I attached the code the of test app. Please check
>> what I have done wrong. Thanks.
>>
>> Best Regards,
>> Lee
>
>
> --
> Jakub Podlešák
> CZJUG co-lead,
> Web Services Research And Development
> Oracle, Czech s r.o.
> Praha 4, V Parku 8
>


--
View this message in context: http://jersey.576304.n2.nabble.com/can-not-unmarshal-nested-generic-list-in-a-wrapper-tp5959000p6090840.html
Sent from the Jersey mailing list archive at Nabble.com.