users@jersey.java.net

Re: [Jersey] Unmarshaling JAXB object from JSON

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Thu, 02 Apr 2009 13:09:32 -0400

Jakub Podlesak wrote:
> One comment at the end...
>
> On Wed, Apr 01, 2009 at 04:54:35PM +0200, Paul Sandoz wrote:
>
>> On Apr 1, 2009, at 4:45 PM, Farrukh Najmi wrote:
>>
>>
>>> Paul Sandoz wrote:
>>>
>>> OK so my code now looks like this:
>>>
>>> List<String> postalAddresses = ...
>>> for (String postalAddressStr : postalAddresses) {
>>> MessageBodyReader r =
>>> providers.getMessageBodyReader(PostalAddressType.class,
>>> PostalAddressType.class, new Annotation[1],
>>> MediaType.APPLICATION_JSON_TYPE);
>>> PostalAddressType postalAddress = (PostalAddressType)
>>> r.readFrom(PostalAddressType.class, PostalAddressType.class, new
>>> Annotation[1], MediaType.APPLICATION_JSON_TYPE,
>>> new InBoundHeaders(),
>>> new ByteArrayInputStream(postalAddressStr.getBytes()));
>>> org.getPostalAddress().add(postalAddress);
>>> }
>>>
>>> I am now getting following exception:
>>>
>>> java.lang.UnsupportedOperationException: Not supported yet.
>>> at
>>> com.sun.jersey.json.impl.JSONUnmarshaller.unmarshal(JSONUnmarshaller.java:175)
>>> at
>>> com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider.readFrom(JSONRootElementProvider.java:119)
>>> at
>>> com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.readFrom(AbstractRootElementProvider.java:97)
>>>
>>>
>> That is definitely a bug with unmarshalling JAXB XML type beans. Can you
>> log an issue? I had a look to see if there is an obvious fix but could not
>> work it out. Need Jakub!
>>
>
> The bug should be fixed now in jersey-json module,
> Farrukh, could you please verify?
>
> I am going to review the corresponding code in more detail
> and write some more tests by end of this week.
>
>

Hi Jakub,

This is to confirm the bug is indeed fixed. I have to say once again
that the jersey dev team is exceptional in their support of the jersey
community and the project itself is an exemplary OS project. Thanks very
much to you, Paul, Marc, Felipe, and Tatu for all your help.

-- 
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com