users@jersey.java.net

Re: [Jersey] Re: Resolved CDI NPE issues with JAX-RS/Jersey

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 28 Oct 2010 14:28:35 +0200

On Oct 28, 2010, at 10:17 AM, Paul Sandoz wrote:

>
> On Oct 27, 2010, at 11:39 PM, John Lister wrote:
>
>> Hi, unfortunately I've discovered another minor NPE relating to CDI
>> use - I've attached a quick patch which fixes it, feel free to
>> modify to meet coding conventions, etc
>>
>> Discovered it having made a simple cut and paster error,
>> essentially if CDI is enabled and an invalid type is injected via
>> @Context it fails with a NPE. I thought but haven't checked that
>> the non CDI case returned a warning and left the value as null...
>>
>
> Thanks!
>
> In such a case Jersey needs to report an error, this should be an
> easy fix, thanks for reporting:
>
> https://jersey.dev.java.net/issues/show_bug.cgi?id=600
>

Fixed. Jersey will report all errors for such cases. Rather than
letting deployment continue and most likely resulting in an NPE at the
application level.

Paul.