cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Huttar <lars_hut...@sil.org>
Subject trouble with ValidationReportTransformer
Date Tue, 25 May 2010 19:07:56 GMT
Hello,
I'm trying to use ValidationReportTransformer in the Cocoon validation
block in 2.1.11. My current use case is with an RNG schema.
When I use the following transform in the sitemap, it works fine:
                <map:transform type="validation-report" src="../{1}.rng"
label="raw-report" />
However when I use the following transform, I get in trouble:
                <map:transform type="validation-report"
src="cocoon://mount/gemination/{1}.rng" label="raw-report" />

In other words, the difference is that when I have a "plain" src URL...
which just leads to a local file... I'm able to validate.
But when my src URL uses a "cocoon://" pipeline, it fails.
(In both cases I have the same generator and the same serializer.)

Here's the error I get:

An Error Occurred
Grammar detected: http://relaxng.org/ns/structure/1.0

The full dump of the stack trace is below.

Looking at the java source code, it looks to me like the exception is
getting thrown as it should by the DetectionHandler,
but for some reason is not getting caught by detectGrammar().

Maybe I can work around the problem by specifying the grammar
explicitly, instead of relying on the component to guess the grammar
(RNG). However, none of the samples in the Cocoon sample block show how
to do this. The Cocoon top-level sitemap shows an example of grammar
config but without telling what values to use for grammar identifiers.
What value do I use to say "rng"?

For documentation, the Cocoon sample block says to go to
http://cocoon.zones.apache.org/daisy/documentation/691.html
but that gives an error!
I found some javadoc at
http://www.java2s.com/Open-Source/Java-Document/Web-Framework/cocoon/org/apache/cocoon/transformation/ValidationReportTransformer.java.java-doc.htm
which helps. But I don't see where to find the allowed values for the
grammar parameter.

Thanks for any help with how to get validation instead of the exception,
or what to use for the grammar parameter.

Lars


org.apache.cocoon.ProcessingException: Failed to process pipeline
    at <map:serialize type="xml"> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/test/sitemap.xmap:42:45
    at <map:transform type="validation-report"> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/test/sitemap.xmap:40:118
    at <map:generate> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/test/sitemap.xmap:38:69
    at <map:mount> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/sitemap.xmap:105:77
    at <map:mount> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/sitemap.xmap:1260:78
    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.setupPipeline(AbstractProcessingPipeline.java:414)
    at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.java:718)
    at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:501)
    at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:453)
    at
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:144)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
    at
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
    at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
    at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
    at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
    at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
    at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
    at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
    at
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
    at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
    at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
    at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
    at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
    at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
    at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
    at
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
    at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
    at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
    at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
    at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
    at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
    at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
    at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
    at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
    at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
    at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
    at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
    at org.mortbay.http.HttpServer.service(HttpServer.java:879)
    at org.mortbay.http.HttpConnection.service(HttpConnection.java:789)
    at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:960)
    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:806)
    at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:218)
    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:300)
    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)
Caused by: org.apache.cocoon.ProcessingException: Failed to process pipeline
    at <map:serialize type="xml"> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/metamodel/sitemap.xmap:98:44
    at <map:generate> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/metamodel/sitemap.xmap:97:47
    at
org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapSource.java:424)
    at
org.apache.cocoon.components.validation.impl.AbstractValidator.detectGrammar(AbstractValidator.java:440)
    at
org.apache.cocoon.components.validation.impl.CachingValidator.detectGrammar(CachingValidator.java:180)
    at
org.apache.cocoon.components.validation.impl.AbstractValidator.getValidationHandler(AbstractValidator.java:305)
    at
org.apache.cocoon.components.validation.impl.AbstractValidator.getValidationHandler(AbstractValidator.java:275)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocationHandler.invoke(ComponentProxyGenerator.java:143)
    at $Proxy34.getValidationHandler(Unknown Source)
    at
org.apache.cocoon.transformation.ValidationReportTransformer.setup(ValidationReportTransformer.java:167)
    at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:398)
    ... 49 more
Caused by: org.apache.cocoon.ProcessingException: Failed to process pipeline
    at <map:serialize type="xml"> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/metamodel/sitemap.xmap:98:44
    at <map:generate> -
file:///C:/Program%20Files/Apache%20Software%20Foundation/cocoon-2.1.11-src/cocoon-2.1.11/build/webapp/mount/gemination/metamodel/sitemap.xmap:97:47
    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.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:380)
    at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:780)
    at
org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapSource.java:414)
    ... 61 more
Caused by:
org.apache.cocoon.components.validation.impl.AbstractValidator$DetectionException:
Grammar detected: http://relaxng.org/ns/structure/1.0
    at
org.apache.cocoon.components.validation.impl.AbstractValidator$DetectionHandler.startElement(AbstractValidator.java:484)
    at
org.apache.cocoon.xml.ContentHandlerWrapper.startElement(ContentHandlerWrapper.java:147)
    at
org.apache.cocoon.components.EnvironmentChanger.startElement(EnvironmentStack.java:140)
    at
org.apache.cocoon.components.sax.XMLTeePipe.startElement(XMLTeePipe.java:87)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
    at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
    at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
    at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:315)
    at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:334)
    at
org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:326)
    at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:116)
    at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:334)
    ... 63 more


Mime
View raw message