Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-1967

NullPointerException during transformation in my web application.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 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

        Hide
        yashtalwar 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
        yashtalwar 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.
        Hide
        minchau@ca.ibm.com 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
        minchau@ca.ibm.com 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.
        Hide
        minchau@ca.ibm.com Brian Minchau added a comment -

        Patch patch.1967.txt was applied to CVS.

        Show
        minchau@ca.ibm.com Brian Minchau added a comment - Patch patch.1967.txt was applied to CVS.
        Hide
        minchau@ca.ibm.com 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
        minchau@ca.ibm.com 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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development