users@jersey.java.net

Re: [Jersey] Null pointer exception in jaxb unmarshalling

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 13 Mar 2009 11:51:11 +0100

Hi Erik,

You might want to send an email to:

   mailto:users_at_jaxb.dev.java.net

and ask the JAXB experts.

Providing a very simple example reproducing your issue would also be
very useful to help them help you.

Paul.

On Mar 13, 2009, at 12:37 AM, Erdinc Yilmazel wrote:

> I think this is something related to XmlWrapperElement annotation. If
> I remove it, it works fine.
> When I look at the xml, it doesn't seem to be missing anything.
>
> On Thu, Mar 12, 2009 at 8:07 PM, Tatu Saloranta
> <tsaloranta_at_gmail.com> wrote:
>> On Thu, Mar 12, 2009 at 12:10 PM, Erdinc Yilmazel <erdinc_at_yilmazel.com
>> > wrote:
>>> Well I'm not sure if this is the right place to post this message,
>>> but
>>> here it goes.
>>> I am getting a null pointer exception while jersey client tries to
>>> unmarshall the returned xml from the web service.
>> ...
>>> Both RegistryEntry and Unit classes are simple java classes
>>> (containing only simple types of attributes like primitives and
>>> string) both annotated with XmlRootElement.
>>
>> This is just a wild guess, but could it be due to auto-unboxing
>> operation used to convert from wrapper type like Integer to primitive
>> type like int?
>> That is, if attribute/element is missing value, that could be taken
>> to
>> mean null, and trying to assign or pass it as an argument to
>> primitive
>> type would give you a strange NPE. I haven't seen this with Jersey,
>> but have encountered it with some other code.
>>
>> -+ Tatu +-
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>