cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kist, Paul" <paul_k...@merck.com>
Subject ExceptionSelector: Exception Not Unrolling
Date Tue, 30 Nov 2004 19:51:47 GMT
Hello everyone,

I am using the ExceptionSelector to do some custom error handling based on
the different Exceptions being thrown.  It looks like the only Exceptions I
am able to do anything with are the java.lang.RuntimeException and the
org.apache.cocoon.ProcessingException.   I set up a situation where a
SourceException is being thrown and here's the error message that gets sent:

Internal Server Error
Message: Failed to execute pipeline.

Description: org.apache.cocoon.ProcessingException: Failed to execute
pipeline.: java.lang.RuntimeException:
org.apache.cocoon.ProcessingException: Exception during source resolving.:
org.apache.excalibur.source.SourceException: Resource not found. There is no
resource with the requested path:
'global/www.msdclinicaltrials.com/facts/poll_default.xml' and promotion
status: uat

Sender: org.apache.cocoon.servlet.CocoonServlet

Source: Cocoon Servlet

Request URI

facts/index.html


Now, It looks like the heirarchy is as follows:  ProcessingException -->
RuntimeException --> ProcessingException --> SourceException


Here's my ExceptionSelector defn:


            <map:selector logger="sitemap.selector.exception"
name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
                <exception
class="org.apache.cocoon.ResourceNotFoundException" name="not-found"/>
                <exception class="java.lang.RuntimeException"
name="run-time" unroll="true"/>                
                <exception class="org.apache.cocoon.ProcessingException"
name="internal-error" unroll="true"/>
                <exception
class="org.apache.excalibur.source.SourceException" name="source"/>

                <exception class="java.sql.SQLException" name="sql"/>
                <exception class="java.lang.Throwable" unroll="true"/>
            </map:selector>

And here's how I'm handling the errors:

				<map:handle-errors>
					<map:select type="exception">
						<map:when
test="internal-error">
							<map:generate
type="notifying"/>
          						<map:serialize
type="xml"/>							
						</map:when>

						<map:when test="run-time">
							<map:generate
type="notifying"/>
          						<map:serialize
type="xml"/>							
						</map:when>

						<map:when test="not-found">

							<map:generate
type="notifying"/>
							<map:serialize
type="xml"/>	
					</map:when>

						<map:when test="source"
							<map:generate
type="notifying"/       						
							<map:serialize
type="xml"/>								
						</map:when>

					</map:select>
				</map:handle-errors>

With this configuration, I get XML back from the NotifyGenerator, but it's
for the ProcessingException.  For some reason it is not unrolling to reveal
the SourceException pipeline.

If I get rid of the test for run-time or internal-error, it goes right to
the default error page, that shows the stack trace.

I haven't seen much on this on the web and newsgroups.  Am I missing
something?

-Paul


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of Merck
& Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates
(which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally
privileged. It is intended solely for the use of the individual or entity named on this message.
 If you are not the intended recipient, and have received this message in error, please notify
us immediately by reply e-mail and then delete it from your system.
------------------------------------------------------------------------------

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


Mime
View raw message