You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Kist, Paul" <pa...@merck.com> on 2004/11/30 20:51:47 UTC

ExceptionSelector: Exception Not Unrolling

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


Re: ExceptionSelector: Exception Not Unrolling

Posted by Joerg Heinicke <jo...@gmx.de>.
On 30.11.2004 20:51, Kist, Paul wrote:

> 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

...

> 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?

I fear there is something broken. Not that I had a deeper look into it, 
but I have the same problem. And same like you I had the feeling to have 
it configured correctly, but I always get the ProcessingException and 
not my own BusinessException as root, so that I can' i18n-ize my backend 
error messages.

Does anybody has it working?

Joerg

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