users@jersey.java.net

Re: [Jersey] Jersey on app engine

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 10 Apr 2009 08:02:26 +0200

On Apr 9, 2009, at 8:41 PM, Tatu Saloranta wrote:

> On Thu, Apr 9, 2009 at 4:51 AM, Paul Sandoz <Paul.Sandoz_at_sun.com>
> wrote:
>>
>> On Apr 9, 2009, at 1:08 PM, Erdinc Yilmazel wrote:
>>
>>> I pulled the latest code from the trunk and deployed the application
>>> to appengine servers. It didn't deploy successfully again since, the
>>> NoClassDefFoundError was not caught by jersey in getContext method
>>> of
>>> WebComponent class. So I added Error in the catch clause and rebuilt
>>> jersey, and deployed my app again.
>>
>> Argh! i should of caught Throwable.
>
> Careful there. :)
> It's often not good to catch Errors -- OOME and others should be let
> percolate appropriately (like the stack-space related one you get for
> infinite recursion).
>
> So it may be better (even if more work) to catch specific "expected"
> errors.
> Fortunarely in this case you could catch LinkageError since that's the
> base error for variety of class loading related errors.
>

Thanks for the advice. I changed the code.

Paul.