cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Guillon <gu...@dainty.ca>
Subject ZipFileSerializer After XInclude Throws NullPointerException
Date Wed, 30 May 2007 16:56:05 GMT
   Hello All,

   I'm writing some sitemap logic for handling Oasis Document Format (ODF) 
files.  However, I've found what looks like a bug in Cocoon-2.1.10.  I get a 
NullPointerException when the ZipFileSerializer is preceded by the XInclude 
transformer.  I constructed a very simple sitemap and XML files, and have 
been able to reproduce the problem.  I'm using Cocoon 2.1.10 with JDK 1.5.  
The problem was also reproduced on Cocoon 2.1.9 with JDK 1.4.

   What's funny is that if I take the resultant XML file after the xinclude 
transformation, and serialize with xml, and then run the zip file serializer 
on that file... everything is fine.  It doesn't look like an XML document 
issue...

Please find relevant info below.... let me know if anything else is needed.

AJ

   Here's a simple sitemap snippet to show the problem:

        <!-- This works OK --->
        <map:match pattern="no-pipeline-simple.zip">
            <map:generate src="no_pipeline.xml"/>
            <map:serialize type="zip"/>
        </map:match>

        <!-- This fails -->
        <map:match pattern="simple.zip">
            <map:generate src="simple_xi.xml"/>
            <map:transform type="xinclude"/>
            <map:serialize type="zip"/>
        </map:match>

        <!-- something to include -->
        <map:match pattern="simple.xml">
            <map:generate src="simple.xml"/>
            <map:serialize type="xml"/>
        </map:match>


Now I have two other files:

simple.xml: <simple>Hello</simple>

simple_xi.xml: 

<?xml version="1.0" encoding="ISO-8859-1"?>
<zip:archive xmlns:zip="http://apache.org/cocoon/zip-archive/1.0" 
xmlns:xi="http://www.w3.org/2001/XInclude" >
 <zip:entry name="content.xml" serializer="xml">
  <xi:include href="cocoon:/simple.xml"/>
 </zip:entry>
</zip:archive>

After executing the XInclude Transformer directly and saving the output, you 
get this file (and running zip serializer just on this file works okay):
no_pipeline.xml:

<?xml version="1.0" encoding="ISO-8859-1"?><zip:archive 
xmlns:zip="http://apache.org/cocoon/zip-archive/1.0" 
xmlns:xi="http://www.w3.org/2001/XInclude">
 <zip:entry name="content.xml" serializer="xml">
  <simple>Hello</simple>
 </zip:entry>
</zip:archive>


===== Stack Trace =====

java.lang.NullPointerException:

Cocoon stacktrace[hide]
Failed to process pipeline
context://utils/oasis/sitemap.xmap - 55:40	<map:serialize type="zip">
context://utils/oasis/sitemap.xmap - 54:45	<map:transform type="xinclude">
context://utils/oasis/sitemap.xmap - 53:48	<map:generate>
context://utils/sitemap.xmap - 10:62	<map:mount>
context://sitemap.xmap - 879:66	<map:mount>

Java stacktrace[hide]

java.lang.NullPointerException
	at 
org.apache.cocoon.xml.AbstractXMLPipe.setDocumentLocator(AbstractXMLPipe.java:40)
	at 
org.apache.cocoon.components.sax.XMLTeePipe.setDocumentLocator(XMLTeePipe.java:113)
	at 
org.apache.cocoon.transformation.XIncludeTransformer$XIncludePipe.processXIncludeElement(XIncludeTransformer.java:476)
	at 
org.apache.cocoon.transformation.XIncludeTransformer$XIncludePipe.startElement(XIncludeTransformer.java:241)
	at 
org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:95)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown 
Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(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:367)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:481)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:121)
	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:253)
	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:253)
	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:253)
	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)

Java full stacktrace[hide]

org.apache.cocoon.ProcessingException: Failed to process pipeline
	at <map:serialize type="zip"> - 
file:/var/cocoon-2.1.10/webapp/utils/oasis/sitemap.xmap:55:40
	at <map:transform type="xinclude"> - 
file:/var/cocoon-2.1.10/webapp/utils/oasis/sitemap.xmap:54:45
	at <map:generate> - 
file:/var/cocoon-2.1.10/webapp/utils/oasis/sitemap.xmap:53:48
	at <map:mount> - file:/var/cocoon-2.1.10/webapp/utils/sitemap.xmap:10:62
	at <map:mount> - file:/var/cocoon-2.1.10/webapp/sitemap.xmap:879:66
	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:379)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:481)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:121)
	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:253)
	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:253)
	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:253)
	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: java.lang.NullPointerException
	at 
org.apache.cocoon.xml.AbstractXMLPipe.setDocumentLocator(AbstractXMLPipe.java:40)
	at 
org.apache.cocoon.components.sax.XMLTeePipe.setDocumentLocator(XMLTeePipe.java:113)
	at 
org.apache.cocoon.transformation.XIncludeTransformer$XIncludePipe.processXIncludeElement(XIncludeTransformer.java:476)
	at 
org.apache.cocoon.transformation.XIncludeTransformer$XIncludePipe.startElement(XIncludeTransformer.java:241)
	at 
org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:95)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown 
Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(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:367)
	... 47 more


Mime
View raw message