You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Robert Leftwich <ro...@leftwich.info> on 2002/08/24 00:16:27 UTC

NPE in AbstractCachingProcessingPipeline

I am encountering a NPE in Cocoon (2002-08-23-103452 nightly build and 
prior, W2000, JDK1.4) and wanted to make sure that it is not something I am 
doing wrong. I've setup a cocoon play area in Resin (2.1.4) by copying the 
WEB-INF from the standard Cocoon, built with installscratchpadwar (after 
running a few samples such as slash-edit to make sure it is working) into a 
cocoon-dev webapp. All the test pipelines I have setup work ok except one, 
which is intended to test some Schematron integration. That pipeline is 
based on the slash-edit setup and is declared as follows:

    <map:pipeline>
         <map:match pattern="test-schematron">
            <map:generate src="content/schematron/page.xml"/>
            <map:transform src="cocoon:/schematron-validator(page)"/>
            <map:serialize type="xml"/>
         </map:match>
    </map:pipeline>

    <map:pipeline>
       <map:match pattern="schematron-validator(*)">
          <map:generate src="content/schematron/schematron-{1}.xml"/>
          <map:transform src="stylesheets/schematron-validator2xsl.xsl"/>
          <map:serialize type="xml"/>
       </map:match>
    </map:pipeline>

Accessing the cocoon-dev/test-schematron uri produces the following NPE:

java.lang.NullPointerException
	at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.java:554)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:475)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:142)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:83)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:163)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:157)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:155)
	at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:327)
	at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:309)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:585)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1000)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
	at 
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
	at com.caucho.server.http.Invocation.service(Invocation.java:312)
	at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
	at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
	at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
	at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
	at java.lang.Thread.run(Thread.java:536)

If I put a check for cachedPipelineKey being null at line 554 of 
AbstractCachingProcessingPipeline.java :

                         if (null != cachedPipelineKey && (i > 0 && i > 
cachedPipelineKey.size())) {...

all is well.

So the question is, what, if anything am I doing wrong or is it a bug ?

Robert


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