cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aron Shamash" <>
Subject RE: Catching a NullPointerException to display custom error page
Date Wed, 10 May 2006 10:09:09 GMT
Yes Reijn

I am using the ExceptionSelector already for catching "page not found"
and "invalid continuation" exceptions :

class="org.apache.cocoon.ResourceNotFoundException" name="not-found"/>

I noticed further down the errorhandling page you cite, there is mention
of null pointer excpetions :

"A NullPointerException occurs, because something went completely wrong
in the application: All handlers are not configured for such an
exception and so the root sitemaps default handler will apply to it
showing a general error page."

Does this mean it is not possible to configure handlers for this type of
exception and therefore not possible display a customer error page?

The Background
The reason for this query is that I am passing a query string parameter
to a page which pulls in content from an xml file.

For example : This displays a popup
using content stored in a file called 11.xml. If the following is typed
into the browser : there is no xml
content to display because the is no foo.xml file and thus a
NullPointerException is thrown.  I would like a "nice" error page to be
display in this instance.

Any ideas gratefully received.



-----Original Message-----
From: Jeroen Reijn [] 
Sent: 10 May 2006 08:33
Subject: Re: Catching a NullPointerException to display custom error

Hi Aron,

did you try the read the errorhandling page?

Perhaps you can try the ExceptionSelector.



Aron Shamash wrote:
> Hello
> Does anyone know a way to catch NullPointerExceptions which will allow

> the display of a custom error page?
> I would have thought that this could be done in the sitemap but failed

> to find a way.
> The application is built using Cocoon 2.1.7
> Aron Shamash
> Senior Interface Developer
> Phone 020 7907 4545
> *DNA *An Avenue A | Razorfish Company

Met vriendelijke groet,
Kind regards,

Jeroen Reijn


Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message