cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Shafer <p...@juniper.net>
Subject Re: Using cocoon: source in <xsl:import>s
Date Mon, 18 Aug 2003 15:04:34 GMT
Vadim Gritsenko writes:
>It's not concern of the resolver's user to fiddle with request / 
>response. If change to be made, it should be done in cocoon source 
>implementation.

This sounds right.

>I think reader has a right to make this call unconditionally.

If the resolver shouldn't fiddle with the response, why do they have
the right to set the content length of the response?

>PS Are you using reader to deliver xsl:import parts? Have you tried 
>generate/serialize pair, which does work?

I'm not making the reader, just trying to import a stylesheet using
a "cocoon:/path" source. The reader is created in the callback
resolver passed down to xalan. Here's a (very long) stacktrace:

   Thread-25[1] where
     [1] org.apache.coyote.Response.checkSpecialHeader (Response.java:386)
     [2] org.apache.coyote.Response.setHeader (Response.java:361)
     [3] org.apache.coyote.tomcat4.CoyoteResponse.setHeader (CoyoteResponse.java:1162)
     [4] org.apache.coyote.tomcat4.CoyoteResponseFacade.setHeader (CoyoteResponseFacade.java:375)
     [5] org.apache.cocoon.environment.http.HttpResponse.setHeader (HttpResponse.java:143)
     [6] org.apache.cocoon.reading.ResourceReader.processStream (ResourceReader.java:254)
     [7] org.apache.cocoon.reading.ResourceReader.generate (ResourceReader.java:292)
     [8] org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processReader (AbstractProcessingPipeline.java:615)
     [9] org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process (AbstractProcessingPipeline.java:486)
     [10] org.apache.cocoon.components.source.impl.SitemapSource.getInputStream (SitemapSource.java:276)
     [11] org.apache.excalibur.xml.xslt.XSLTProcessorImpl.getInputSource (XSLTProcessorImpl.java:777)
     [12] org.apache.excalibur.xml.xslt.XSLTProcessorImpl.resolve (XSLTProcessorImpl.java:704)
     [13] org.apache.xalan.xsltc.trax.TemplatesHandlerImpl.loadSource (TemplatesHandlerImpl.java:252)
     [14] org.apache.xalan.xsltc.compiler.Import.parseContents (Import.java:108)
     [15] org.apache.xalan.xsltc.compiler.Stylesheet.parseOwnChildren (Stylesheet.java:435)
     [16] org.apache.xalan.xsltc.compiler.Stylesheet.parseContents (Stylesheet.java:407)
     [17] org.apache.xalan.xsltc.compiler.Import.parseContents (Import.java:150)
     [18] org.apache.xalan.xsltc.compiler.Stylesheet.parseOwnChildren (Stylesheet.java:435)
     [19] org.apache.xalan.xsltc.compiler.Stylesheet.parseContents (Stylesheet.java:407)
     [20] org.apache.xalan.xsltc.compiler.Parser.createAST (Parser.java:420)
     [21] org.apache.xalan.xsltc.trax.TemplatesHandlerImpl.getTemplates (TemplatesHandlerImpl.java:204)
     [22] org.apache.excalibur.xml.xslt.XSLTProcessorImpl.getTransformerHandlerAndValidity
(XSLTProcessorImpl.java:316)
     [23] org.apache.cocoon.transformation.TraxTransformer.setup (TraxTransformer.java:302)
     [24] org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline (AbstractProcessingPipeline.java:391)
     [25] org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline
(AbstractProcessingPipeline.java:505)
     [26] org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process (AbstractProcessingPipeline.java:467)
     [27] org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke (SerializeNode.java:150)
     [28] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:84)
     [29] org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke (ActTypeNode.java:158)
     [30] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:84)
     [31] org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke (PreparableMatchNode.java:164)
     [32] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:108)
     [33] org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke (PipelineNode.java:162)
     [34] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:108)
     [35] org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke (PipelinesNode.java:162)
     [36] org.apache.cocoon.components.treeprocessor.TreeProcessor.process (TreeProcessor.java:325)
     [37] org.apache.cocoon.components.treeprocessor.TreeProcessor.process (TreeProcessor.java:307)
     [38] org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke (MountNode.java:133)
     [39] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:84)
     [40] org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke (PreparableMatchNode.java:164)
     [41] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:84)
     [42] org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke (PreparableMatchNode.java:164)
     [43] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:84)
     [44] org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke (ActTypeNode.java:158)
     [45] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:84)
     [46] org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke (PreparableMatchNode.java:164)
     [47] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:108)
     [48] org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke (PipelineNode.java:162)
     [49] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:108)
     [50] org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke (PipelinesNode.java:162)
     [51] org.apache.cocoon.components.treeprocessor.TreeProcessor.process (TreeProcessor.java:325)
     [52] org.apache.cocoon.components.treeprocessor.TreeProcessor.process (TreeProcessor.java:307)
     [53] org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke (MountNode.java:133)
     [54] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:84)
     [55] org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke (PreparableMatchNode.java:164)
     [56] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:108)
     [57] org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke (PipelineNode.java:162)
     [58] org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes
(AbstractParentProcessingNode.java:108)
     [59] org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke (PipelinesNode.java:162)
     [60] org.apache.cocoon.components.treeprocessor.TreeProcessor.process (TreeProcessor.java:325)
     [61] org.apache.cocoon.components.treeprocessor.TreeProcessor.process (TreeProcessor.java:307)
     [62] org.apache.cocoon.Cocoon.process (Cocoon.java:626)
     [63] org.apache.cocoon.servlet.CocoonServlet.service (CocoonServlet.java:1083)
     [64] javax.servlet.http.HttpServlet.service (HttpServlet.java:853)
     [65] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:247)
     [66] org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:193)
     [67] org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:256)
     [68] org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
     [69] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:480)
     [70] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:995)
     [71] org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:191)
     [72] org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
     [73] org.apache.catalina.valves.CertificatesValve.invoke (CertificatesValve.java:246)
     [74] org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:641)
     [75] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:480)
     [76] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:995)
     [77] org.apache.catalina.core.StandardContext.invoke (StandardContext.java:2415)
     [78] org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:180)
     [79] org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
     [80] org.apache.catalina.valves.ErrorDispatcherValve.invoke (ErrorDispatcherValve.java:171)
     [81] org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:641)
     [82] org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172)
     [83] org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:641)
     [84] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:480)
     [85] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:995)
     [86] org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:174)
     [87] org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
     [88] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:480)
     [89] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:995)
     [90] org.apache.coyote.tomcat4.CoyoteAdapter.service (CoyoteAdapter.java:223)
     [91] org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:594)
     [92] org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection
(Http11Protocol.java:392)
     [93] org.apache.tomcat.util.net.TcpWorkerThread.runIt (PoolTcpEndpoint.java:565)
     [94] org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:619)
     [95] java.lang.Thread.run (Thread.java:512)
   Thread-25[1] print name
    name = "Content-Length"
   Thread-25[1] print contentLength
    contentLength = 23004


So in frame 13 xalan is loading a source using the the loader passed
into it by excalibur, which calls back into cocoon proper. Cocoon
makes this source using ResourceReader, but the reader code thinks it
needs to set the content length. Unfortunately the response upon which
is sets the content length is the original response passed in by
catalina, so setting the content length causes catalina to truncate
any final response from cocoon to the length of the imported
stylesheet.

So should the ResourceReader not touch the response? Or should
cocoon or excalibur be building a new internal-use response that
ResourceReader can freely change since it will be discarded? Or
is the problem somewhere else I'm not seeing?

Thanks,
 Phil

Mime
View raw message