Hello
I'm experiencing a strange behaviour in Cocoon 2.1, where the mere
presence of an "xsltc" transformer in a pipeline hides exceptions
raised in a CIncluded resource.
Here is a basic example:
___ sitemap: ___________________________________________________________
<match pattern="page">
<generate src="page.xml"/>
(1) <transform type="xsltc" src="noop.xsl"/>
<transform type="cinclude"/>
<serialize/>
</match>
<match pattern="raise">
<generate src="doesnt-exist"/>
<serialize/>
</match>
___ page.xml: __________________________________________________________
<html xmlns:cinclude="http://apache.org/cocoon/include/1.0">
<cinclude:include src="cocoon:/raise"/>
</html>
___ noop.xsl: __________________________________________________________
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
________________________________________________________________________
I call /page on the browser, which passes through a no-op
transformation, calls cocoon:/raise for inclusion, which raises a
Resource Not Found exception, which should magically "bubble out" of
the cinclude transformer and land on the browser.
If transformer (1) is the default xalan-interpretive "xslt", that's
what happens. But if I use the compiling "xsltc" transformer, I get
an opaque "Exception in CIncludeTransformer" (see below) that hides
the real cause of the exception.
This is particularly a problem when the included resource is a
function or continuation call, because then I don't have the slightest
idea of what caused the exception. Even in the logs there is no trace
of the original message, that would tell me for example the line of
flowscript that caused the error. It's very annoying!
Do you have any idea why this is happening and how can I solve it?
I tried poking around in
org.apache.cocoon.components.xslt.TraxProcessor but couldn't find
anything misplaced about the way it handles exceptions.
Tobia
________________________________________________________________________
This is an excerpt from the exception page:
javax.xml.transform.TransformerException: Exception in
CIncludeTransformer
org.apache.cocoon.ProcessingException: Failed to process pipeline
at <map:serialize> - file:/opt/cocoon/WEB-INF/sitemap.xmap:295:13
at <map:transform type="cinclude"> - file:/opt/cocoon/WEB-INF/
sitemap.xmap:294:29
at <map:transform type="xsltc"> - file:/opt/cocoon/WEB-INF/
sitemap.xmap:293:44
at <map:generate> - file:/opt/cocoon/WEB-INF/sitemap.xmap:292:32
at
org
.apache
.cocoon.ProcessingException.throwLocated(ProcessingException.java:145)
at
org
.apache
.cocoon
.components
.pipeline
.AbstractProcessingPipeline
.handleException(AbstractProcessingPipeline.java:953)
at
org
.apache
.cocoon
.components
.pipeline
.AbstractProcessingPipeline
.processXMLPipeline(AbstractProcessingPipeline.java:583)
...
Caused by: org.apache.commons.lang.exception.NestableRuntimeException:
javax.xml.transform.TransformerException: Exception in
CIncludeTransformer
at
org
.apache
.cocoon
.transformation.TraxTransformer.endDocument(TraxTransformer.java:604)
at
org
.apache
.cocoon
.components
.sax.XMLByteStreamInterpreter.parse(XMLByteStreamInterpreter.java:83)
...
Caused by: javax.xml.transform.TransformerException: Exception in
CIncludeTransformer
at
org
.apache
.xalan
.xsltc.trax.TransformerImpl.postErrorToListener(TransformerImpl.java:
693)
at
org
.apache
.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:639)
...