cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Skaistis" <jeff.skais...@alistia.com>
Subject RE: [C2] Patch: ArrayIndexOutOfBoundsException after other exceptions
Date Fri, 01 Jun 2001 14:23:50 GMT
Carsten,

Thanks.  Clearing the stack after an exception didn't cause any problems in
my tests, but I agree there are probably cases when it would.

I have one other related suggestion.  Currently if an XSP page generates an
exception other than IOException, SAXException, or ProcessingException, it
is caught but not re-thrown.  So, it doesn't end up being reported, and all
the user sees is a incomplete (although valid if the event stack clearing
worked) XML page.  It would be nice if any exception was reported through
the Cocoon XML page.  The workaround is to put a try/catch in the XSP page
and re-throw any exceptions as SAXExceptions, but I think that's more work
than it's worth (You have to do that anyway if you use any classes that
throw explict exceptions, but that's a different topic.)

In ServerPagesGenerator.generate(), if the following line is added:

    } catch (Exception e){
        getLogger().error("Exception in ServerPagesGenerator.generate()",
e);
>>>     throw new ProcessingException("Exception in
ServerPagesGenerator.generate()", e);
    } finally {

Any other exception from the XSP page will be re-thrown and the Cocoon error
page will be displayed.  It also allows the XSP developer to catch the
exception and just return from the page to keep the error page from being
displayed and the normal event stack cleanup to occur.

Let me know what you think.

-------------------------
Jeff Skaistis
jeff.skaistis@alistia.com

> -----Original Message-----
> From: Carsten Ziegeler [mailto:cziegeler@sundn.de]
> Sent: Friday, June 01, 2001 2:01 AM
> To: cocoon-dev@xml.apache.org
> Subject: AW: [C2] Patch: ArrayIndexOutOfBoundsException after other
> exceptions
>
>
> Hi Jeff,
>
> applied part of your patch. Thanks!
>
> I only added the clearing of the event stack during the recylce()
> method as I think it is not good to send sax events after an
> exception occured.
>
> Thanks for your patch
>
>
> Carsten
>
> Open Source Group                        sunShine - b:Integrated
> ================================================================
> Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
> www.sundn.de                          mailto: cziegeler@sundn.de
> ================================================================
>
>
> > Jeff Skaistis wrote:
> >
> >
> > Hi all,
> >
> > The attached patch to ServerPagesGenerator.java fixes an issue with
> > ArrayIndexOutOfBoundsExceptions (from xalan) being appended to
> pages after
> > another exception is thrown while procssing a page previously.
> >
> > It makes sure that the event stack is always cleared after
> > processing a page
> > with an exception, as well as when the component is recycled.
> >
> > -------------------------
> > Jeff Skaistis
> > jeff.skaistis@alistia.com
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message