cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lionel Crine <>
Subject Re: Exception handling in sitemap
Date Thu, 09 Jun 2005 16:33:14 GMT
Did you throw the errors in the xsp ?

The handle error can not catch it if you don't throw it.

Nicole Erbe wrote:

>Hi everyone,
>I'm trying to handle the following error with an exception selector in
>cocoon sitemap.
>I get the following error:
>Exception in ServerPagesGenerator.generate()
>org.apache.cocoon.ProcessingException: Exception in
>ServerPagesGenerator.generate(): java.lang.NullPointerException
>cause: java.lang.NullPointerException
>I get this exception if a request with an invalid date stamp (i.e.
>30.02.2004) is passed through a postgresql database and the returned
>value is simply "null".
>The easiest way might be to show the user of the related application
>an error page (i.e. "invalid input values"). So I don't have to change
>every concerning xsp and java file (belonging to a system which get's
>test data and delivers xml/pdf etc.). This could be done via exception
>handling in the cocoon sitemap as far as I got the functionality
>In the sitemap I added the following selector:
><map:selectors default="browser">
>     <map:selector name="exception"
>            <exception class="java.lang.NullPointerException"
>name="invalidInput" />
>            <exception class="org.apache.cocoon.ProcessingException"
>name="geterror" />
>     </map:selector>
>                            <map:select type="exception">
>                                <map:when test="invalidInput">
>                                    <map:generate src="notifying"/>
>                                    <map:serialize type="xml"/>
>                                </map:when>
>                                <map:when test="geterror">
>                                    <map:generate src="notifying"/>
>                                    <map:serialize type="xml"/>
>                                </map:when>
>                            </map:select>
>                        </map:handle-errors>
>I know that I have to give the appropriate information to get the
>right error page. But the exception handling itself doesn't work. I
>still get the cocoon error page "an error occurred" and  not what's
>defined in <map:handle-errors>.
>Is there anyone who can help me please. Sorry in case I made an
>absolute stupid mistake because I'm a cocoon newbie.
>Thanks a lot
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : Fax :

View raw message