Cocoon
  1. Cocoon
  2. COCOON-1492

NPE by adding an extra HTML tag in hello.xml

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.7
    • Fix Version/s: None
    • Component/s: * Cocoon Core
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      I downloaded 2.1.7, built it, and started with the cocoon.sh. Most of the samples seem working just
      fine, and they are very nice.

      However, there is a very simple problem with the Hello World sample. I added an extra html tag, such
      as <b>, in the hello.xml file, then the HTML generation from the XML file started failing and saying
      NullPointerException. It does not happen when generating XHTML or CHTML from the same XML file.

      I could reproduce this on the following platforms:
      HPUX w/ Java 1.3.1.11
      Mac OS X (Panther) w/ Java 1.4.2

      Modified hello.xml:
      <page>
       <title>Hello</title>
       <content>
        <para>This is my <b>first</b> Cocoon page!</para>
       </content>
      </page>


      Stacktrace:
      org.apache.cocoon.ProcessingException: Error executing pipeline.: java.lang.RuntimeException:
      java.lang.NullPointerException
              at
      org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.handleException(AbstractProcessin
      gPipeline.java:940)
              at
      org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(A
      bstractCachingProcessingPipeline.java:281)
              at
      org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline
      .java:483)
              at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:
      120)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:46)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchN
      ode.java:130)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:
      138)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:234)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:176)
              at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
              at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:46)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchN
      ode.java:130)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:
      138)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:234)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:176)
              at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
              at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:46)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchN
      ode.java:130)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:
      138)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:234)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:176)
              at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
              at org.apache.cocoon.Cocoon.process(Cocoon.java:608)
              at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1123)
              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.RuntimeException: java.lang.NullPointerException
              at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3418)
              at
      org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:
      389)
              at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55)
              at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:560)
              at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
              at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
              at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
              at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
              at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
              at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:296)
              at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:315)
              at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:275)
              at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:115)
              at
      org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(A
      bstractCachingProcessingPipeline.java:269)
              ... 47 more
      java.lang.RuntimeException: java.lang.NullPointerException
              at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3418)
              at
      org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:
      389)
              at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55)
              at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:560)
              at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
              at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
              at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
              at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
              at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
              at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:296)
              at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:315)
              at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:275)
              at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:115)
              at
      org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(A
      bstractCachingProcessingPipeline.java:269)
              at
      org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline
      .java:483)
              at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:
      120)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:46)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchN
      ode.java:130)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:
      138)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:234)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:176)
              at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
              at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:46)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchN
      ode.java:130)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:
      138)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:234)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:176)
              at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
              at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:46)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchN
      ode.java:130)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:
      138)
              at
      org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar
      entProcessingNode.java:68)
              at
      org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:234)
              at
      org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.j
      ava:176)
              at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
              at org.apache.cocoon.Cocoon.process(Cocoon.java:608)
              at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1123)
              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)

        Activity

        Hide
        Antonio Gallardo added a comment -
        Can be this bug be related to:

        http://issues.apache.org/jira/browse/XALANJ-1901 wich was reported after reading
        this http://issues.apache.org/jira/browse/XALANJ-1628

        I see a relation with XALANJ-1628. The m_elemContext becomes null (as Vadim
        reported in #1). But I also found a problem related to the ApplyTemplates
        function and a relation to XALANJ-1901.

        This bug is imposible to reproduce using the Xalan command line on the CVS. But
        using the compiled CVS xalan.jar inside cocoon shows the bug is still there.

        All in all, I think, this is definitely a Xalan bug. I will try to find more info.
        Show
        Antonio Gallardo added a comment - Can be this bug be related to: http://issues.apache.org/jira/browse/XALANJ-1901 wich was reported after reading this http://issues.apache.org/jira/browse/XALANJ-1628 I see a relation with XALANJ-1628 . The m_elemContext becomes null (as Vadim reported in #1). But I also found a problem related to the ApplyTemplates function and a relation to XALANJ-1901 . This bug is imposible to reproduce using the Xalan command line on the CVS. But using the compiled CVS xalan.jar inside cocoon shows the bug is still there. All in all, I think, this is definitely a Xalan bug. I will try to find more info.
        Hide
        Vadim Gritsenko added a comment -
        (In reply to comment #2)
        > The solution is comment lines from 726 to 731 and 840 to 845 in
        > org.apache.xml.serializer.ToHTMLStream.java (current CVS).

        http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xml/serializer/ToHTMLStream.java?annotate=1.37

        The code you are referring to was written 2 years ago (revision 1.1). Are you
        sure that it is the cause of the problem? I'm not sure that we had this bug for
        2 years, it seems that this is recent bug. WDYT?


        > Can I commit a fixed xalan.jar?

        I'd wait for response from xalan team first.

        Vadim
        Show
        Vadim Gritsenko added a comment - (In reply to comment #2) > The solution is comment lines from 726 to 731 and 840 to 845 in > org.apache.xml.serializer.ToHTMLStream.java (current CVS). http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xml/serializer/ToHTMLStream.java?annotate=1.37 The code you are referring to was written 2 years ago (revision 1.1). Are you sure that it is the cause of the problem? I'm not sure that we had this bug for 2 years, it seems that this is recent bug. WDYT? > Can I commit a fixed xalan.jar? I'd wait for response from xalan team first. Vadim
        Hide
        Antonio Gallardo added a comment -
        Show
        Antonio Gallardo added a comment - Filled a xalan bug report: http://issues.apache.org/jira/browse/XALANJ-2111
        Hide
        Antonio Gallardo added a comment -
        The solution is comment lines from 726 to 731 and 840 to 845 in
        org.apache.xml.serializer.ToHTMLStream.java (current CVS).

        This makes the serializer to service the SAX events as XML and this seems to be
        the cause of the trouble.

        Can I commit a fixed xalan.jar?
        Show
        Antonio Gallardo added a comment - The solution is comment lines from 726 to 731 and 840 to 845 in org.apache.xml.serializer.ToHTMLStream.java (current CVS). This makes the serializer to service the SAX events as XML and this seems to be the cause of the trouble. Can I commit a fixed xalan.jar?
        Hide
        Vadim Gritsenko added a comment -
        I can confirm that. First NPE happens in:
          org.apache.xml.serializer.ToHTMLStream.endElement(), line 840.
        Which is probably the cause; This class is part of
        xalan-2.6.1-dev-20041008T0304.jar.
        Show
        Vadim Gritsenko added a comment - I can confirm that. First NPE happens in:   org.apache.xml.serializer.ToHTMLStream.endElement(), line 840. Which is probably the cause; This class is part of xalan-2.6.1-dev-20041008T0304.jar.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sakai, Kazuhiro
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development