users@jersey.java.net

[Jersey] Re: Generics coleections in return type

From: Martin Matula <martin.matula_at_oracle.com>
Date: Fri, 18 Mar 2011 18:38:43 +0100

Hi,
The fix is now in. So if you build from trunk or wait for the next
1.6-SNAPSHOT to be pushed later today, reading and writing of
List<JAXBElement<?>> or JAXBElement<?>[] should work.
Martin



On 17.3.2011 16:41, Martin Matula wrote:
> I have a fix - actually I had it yesterday - pending sample, formal
> test and code review - I should be able to commit it tomorrow.
> Martin
>
> On 17.3.2011 15:18, Pavel Bucek wrote:
>> I investigated around this a little too, but there doesn't seem to be
>> easy solution..
>>
>> .. problem is in AbstractListElementProvider, in the way how it
>> obtains type arguments. I guess we would need to have another
>> implementation of AbstractJAXBProvider to provide this functionality.
>>
>> can you please file new issue, so we won't forget about this?
>>
>> Thanks,
>> Pavel
>>
>> On 03/17/2011 12:51 AM, Martin Matula wrote:
>>> Hi,
>>> Currently this is not supported. Let me see if I can fix it.
>>> Martin
>>>
>>> On Mar 15, 2011, at 8:43 PM, Shalom Kazaz wrote:
>>>
>>>> Hi
>>>> I have a resource method that needs to return
>>>> List<JAXBElement<Message>>
>>>>
>>>> but jersey doesn't support it by default:
>>>> A message body writer for Java class java.util.ArrayList, and Java
>>>> type
>>>> java.util.List<javax.xml.bind.JAXBElement<com.my.Message>>, and
>>>> MIME media type
>>>> application/json was not found
>>>>
>>>>
>>>> what is the way to marshall this return type?
>>>>
>>>
>>