cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Riedel <dennis_rie...@web.de>
Subject Re: NullPointerException after a <transform type="xinclude"/>
Date Tue, 28 Jun 2005 11:15:07 GMT
Have you registered the XInclude Transformer in your sitemap?


Katharina Kreis wrote:

> Hi!
>
> I get a NullPointerException when transforming a xinclude. Can anybody 
> tell me why?
> Thanks Katharina
>
> P.S. Here are my files:
>
> This is my sitemap:
> ===================
>
>            <map:match pattern="bs-portlets-stockwerk">
>                        <map:generate type="portal"/>
>                        <map:transform 
> src="styles/portal/portal_stockwerk.xsl"/>
>                        <map:transform 
> src="styles/portal/dyn_stockwerk.xsl">
>                            <map:parameter name="id" 
> value="{request-param:id}"/>
>                            <map:parameter name="gebaeudeid" 
> value="{request-param:gebaeudeid}"/>
>                        </map:transform>                               
>     <!-- Output here see below -->
>                        <map:transform type="xinclude"/>    <!-- Here 
> comes the error!!! -->
>                        <map:serialize type="xml"/>
>            </map:match>
>                       <map:match pattern="bsplt_svg_data">
>                        <map:generate src="svg/embedsvg.xml"/>
>                        <map:transform type="xslt" src="svg/embedsvg.xsl">
>                            <map:parameter name="stockwerkId" 
> value="{request-param:id}"/>
>                            <map:parameter name="gebaeudeId" 
> value="{request-param:gebaeudeid}"/>
>                        </map:transform>
>                        <map:serialize type="xml"/>
>            </map:match>
>
>
> styles/portal/dyn_stockwerk.xsl:
> ================================
>
>            <?xml version="1.0"?>
>            <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> xmlns:xi="http://www.w3.org/2001/XInclude">
>            <xsl:param name="id" />
>            <xsl:param name="gebaeudeid"/>
>            <xsl:template match="dyn_portlet">
>            <xi:include><xsl:attribute 
> name="href"><xsl:apply-templates/><xsl:text>?id=</xsl:text><xsl:value-of

> select="$id"/><xsl:text>&amp;gebaeudeid=</xsl:text><xsl:value-of

> select="$gebaeudeid"/></xsl:attribute></xi:include>
>            </xsl:template>
>            <!-- Copy all and apply templates -->
>              <xsl:template match="@*|node()">
>               <xsl:copy>
>                <xsl:apply-templates select="@*|node()" />
>               </xsl:copy>
>              </xsl:template>
>            </xsl:stylesheet>
>
> Output after dyn_stockwerk.xsl:
> ================================
>        ...
>            <content>
>              <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 
> href="cocoon:/bsplt_svg_data?id=1076002008&gebaeudeid=1" />
>          </content>
>        ...
>
> embedsvg.xml:
> =============
>
>        <?xml version="1.0"?>
>        <p>
>            <embed 
> src="http://localhost:8080/cocoon/20050517app/bsplt_svg_stockwerk?bs=yes&amp;type=stockwerk"

> name="svgframe" id="svgframe" width="455"
>            height="500" type="image/svg+xml" border="0"></embed>
>            <iframe 
> src="http://localhost:8080/cocoon/20050517app/bsplt_embed" 
> scrolling="no" width="0" align="center" height="0" name="formframe" 
> id="formframe" type="text/html"></iframe>
>        </p>
>
>
> embedsvg.xsl:
> =============
>
>        <?xml version="1.0"?>
>        <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> xmlns:xi="http://www.w3.org/2001/XInclude">
>               <xsl:param name="stockwerkId"/>
>        <xsl:param name="gebaeudeId"/>
>               <xsl:template match="p">
>                   <xsl:variable name="href" 
> select="embed[@id='svgframe']/@src"/>
>            <xsl:variable name="Anhang">
>                <xsl:text>&amp;id=</xsl:text><xsl:value-of 
> select="$stockwerkId"/>
>                <xsl:text>&amp;gid=</xsl:text><xsl:value-of 
> select="$gebaeudeId"/>
>            </xsl:variable>
>            <xsl:variable name="src" select="concat($href,$Anhang)"/>
>                       <xsl:element name="p">
>                <xsl:attribute name="xmlns:xi"><xsl:value-of 
> select="'http://www.w3.org/2001/XInclude'"/></xsl:attribute>
>            <xsl:element name="embed">
>                <xsl:attribute name="name"><xsl:value-of 
> select="'svgframe'"/></xsl:attribute>
>                <xsl:attribute name="id"><xsl:value-of 
> select="'svgframe'"/></xsl:attribute>
>                <xsl:attribute name="width"><xsl:value-of 
> select="'455'"/></xsl:attribute>
>                <xsl:attribute name="height"><xsl:value-of 
> select="'500'"/></xsl:attribute>
>                <xsl:attribute name="src"><xsl:value-of select= 
> '$src'/></xsl:attribute>
>                <xsl:attribute name="type"><xsl:value-of 
> select="'image/svg+xml'"/></xsl:attribute>
>                <xsl:attribute name="border"><xsl:value-of 
> select="'0'"/></xsl:attribute>
>            </xsl:element>
>              <xsl:copy-of select="iframe"/>
>              </xsl:element>
>               </xsl:template>
>               </xsl:stylesheet>
>
>
> Output from bsplt_svg_data:
> ============================
>
>        <p xmlns:xi="http://www.w3.org/2001/XInclude">
>          <embed name="svgframe" id="svgframe" width="455" height="500" 
> src="http://localhost:8080/cocoon/20050517app/bsplt_svg_stockwerk?bs=yes&type=stockwerk&id=1076002008&gid=1"

> type="image/svg+xml" border="0" />
>          <iframe 
> src="http://localhost:8080/cocoon/20050517app/bsplt_embed" 
> scrolling="no" width="0" align="center" height="0" name="formframe" 
> id="formframe" type="text/html" />
>        </p>
>
>
> ERROR:
> ======
>
> Original Exception: java.lang.RuntimeException: 
> java.lang.RuntimeException: org.apache.cocoon.ProcessingException: 
> Failed to execute pipeline.: java.lang.RuntimeException: 
> java.lang.NullPointerException
>    at 
> org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3407) 
>
>    at 
> org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:433)

>
>    at 
> org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:91) 
>
>    at 
> org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:583)

>
>    at 
> org.apache.cocoon.webapps.portal.generation.PortalGenerator.generate(PortalGenerator.java:91)

>
>    at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:581)

>
>    at 
> org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:196)

>
>    at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:525)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:155)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:173)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:136)

>
>    at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:371)

>
>    at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:312)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:165)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162)

>
>    at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)

>
>    at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:136)

>
>    at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:371)

>
>    at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:312)

>
>    at org.apache.cocoon.Cocoon.process(Cocoon.java:656)
>    at 
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1112)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>    at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)

>
>    at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)

>
>    at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257) 
>
>    at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

>
>    at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) 
>
>    at 
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)

>
>    at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199) 
>
>    at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

>
>    at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) 
>
>    at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184) 
>
>    at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

>
>    at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164) 
>
>    at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)

>
>    at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) 
>
>    at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156) 
>
>    at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

>
>    at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) 
>
>    at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
>    at 
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
>    at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833) 
>
>    at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)

>
>    at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619) 
>
>    at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688) 
>
>    at java.lang.Thread.run(Thread.java:534)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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


Mime
View raw message