XalanJ2
  1. XalanJ2
  2. XALANJ-1967

NullPointerException during transformation in my web application.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Labels:
      None
    • Environment:
      Windows 2000. Xalan Java 2.6.0

      Description

      The following error occurs in when I run my application.

      ----------------------------
      java.lang.NullPointerException
      at org.apache.xml.serializer.ToHTMLStream.processAttribute(ToHTMLStream.java:957)
      at org.apache.xml.serializer.ToHTMLStream.processAttributes(ToHTMLStream.java:1644)
      at org.apache.xml.serializer.ToHTMLStream.endElement(ToHTMLStream.java:883)
      at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:708)
      ----------------------------

      My application is big, I cannot provide my application as testcase. However, I do know the reason for this failure. I will provide a patch that provide a more reasonable error message rather than NullPointerException.

      1. patch.1967.txt
        4 kB
        Brian Minchau
      2. Patch.txt
        5 kB
        Yash Talwar

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        13d 1h 56m 1 Brian Minchau 06/Oct/04 21:12
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12571759 ] jira [ 12595311 ]
        Mark Thomas made changes -
        Workflow jira [ 37439 ] Default workflow, editable Closed status [ 12571759 ]
        Brian Minchau made changes -
        Affects Version/s 2.7.1 [ 10863 ]
        Affects Version/s 2.7 [ 11080 ]
        Hide
        Brian Minchau added a comment -

        This issue is no longer relevant for 2.7.1, it is fixed in 2.7.1.
        Changing the affected version to 2.7.

        Show
        Brian Minchau added a comment - This issue is no longer relevant for 2.7.1, it is fixed in 2.7.1. Changing the affected version to 2.7.
        Brian Minchau made changes -
        Fix Version/s 2.7 [ 11080 ]
        Brian Minchau made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Brian Minchau added a comment -

        Patch patch.1967.txt was applied to CVS.

        Show
        Brian Minchau added a comment - Patch patch.1967.txt was applied to CVS.
        Brian Minchau made changes -
        Attachment patch.1967.txt [ 17845 ]
        Hide
        Brian Minchau added a comment -

        Modfied the patch to patch.1966.txt (attached) which uses spaces,
        not tabs, when indenting. This reduces the number of differences when
        reviewing with the help of "diff" tools.

        Show
        Brian Minchau added a comment - Modfied the patch to patch.1966.txt (attached) which uses spaces, not tabs, when indenting. This reduces the number of differences when reviewing with the help of "diff" tools.
        Brian Minchau made changes -
        Component/s Xalan [ 11321 ]
        Brian Minchau made changes -
        Component/s Xalan [ 11321 ]
        Component/s Diagnostic messages/resources [ 11331 ]
        Yash Talwar made changes -
        Field Original Value New Value
        Attachment Patch.txt [ 17770 ]
        Hide
        Yash Talwar added a comment -

        In my stylesheet, I used <xsl:namespace-alias> as follows:

        <xsl:namespace-alias stylesheet-prefix="xhtml" result-prefix="#default"/>

        However, I did not declare the default namespace uri. If I decalre the default namespace even with uri as empty string, my application works fine. So it is a user error. However, NullPointerException is not a good feedback to use for the error. The proposed patch provide a more reasonable error message to the user.

        Show
        Yash Talwar added a comment - In my stylesheet, I used <xsl:namespace-alias> as follows: <xsl:namespace-alias stylesheet-prefix="xhtml" result-prefix="#default"/> However, I did not declare the default namespace uri. If I decalre the default namespace even with uri as empty string, my application works fine. So it is a user error. However, NullPointerException is not a good feedback to use for the error. The proposed patch provide a more reasonable error message to the user.
        Yash Talwar created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Yash Talwar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development