On Apr 21, 2010, at 8:53 PM, Diego Gil wrote:
> On Wed, 2010-04-21 at 17:43 +0200, Paul Sandoz wrote:
>> On Apr 21, 2010, at 5:35 PM, Diego Gil wrote:
>>
>>> Maybe the only thing we are missing is the registration of our
>>> ExceptionMapper implementation, but I couldn't find how to do it.
>>>
>>> Any hint ?.
>>>
>>
>> See here:
>>
>> https://jersey.dev.java.net/nonav/documentation/latest/user-
>> guide.html#d4e217
>>
>> What is your web.xml?
>>
>> What is the package the ExceptionMapper is in? is it separate from
>> the
>> package that the resource classes are in?
>>
>> In you logs you should expect to see something like the following:
>>
>> INFO: Root resource classes found:
>> class org.Foo
>> Apr 21, 2010 5:27:07 PM
>> com.sun.jersey.api.core.ScanningResourceConfig
>> logClasses
>> INFO: Provider classes found:
>> class org.ExceptionMapper
>>
>
> ExceptionMapper was outside scanned package. We only needed to include
> it in proper package. That was our fault.
>
> With sample MyMapper you send us, now we catching too many exceptions.
> Even unexpected ones. :-)
>
That will be expected when mapping WebApplicationException. That is
why the pseudo code i sent was checking the Response. It is thrown in
a lot of places by Jersey or potentially by the application. It is
necessary to ignore Response state you are not interested and adapt
Response state that matches what you need to modify.
> We are researching the origin of that and will come back if can't find
> the solution.
>
> Thanks you very much for excellent support!.
>
Np,
Paul.