You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by xa...@xml.apache.org on 2004/09/06 08:31:36 UTC

[jira] Updated: (XALANJ-1628) NullPointerException in TransformerImpl.run() when reusing XMLFilter object

The following issue has been updated:

    Updater: Brian Minchau (mailto:minchau@ca.ibm.com)
       Date: Sun, 5 Sep 2004 11:30 PM
    Changes:
             assignee changed from Xalan Developers Mailing List
             description changed from Whenever I attempt to re-use an XMLFilter object, I receive the following stack
trace (first use of the XMLFilter was successful, so it doesn't appear to be my
XSL script):

Exception in thread "main" java.lang.RuntimeException:
java.lang.NullPointerException
        at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3364)
        at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:427)
        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.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:191)
        at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:191)
        at transform.Transform.doTransform(Transform.java:298)
        at transform.Transform.doTransform(Transform.java:279)
        at transform.Transform.main(Transform.java:204)

I traced this to the following line in TransformerImpl.applyTemplateToNode():

DTM dtm = m_xcontext.getDTM(child);

This appears to be returning null when the XMLFilter object is being used for
the second time.  If I comment out the:

m_xcontext.reset();

line in TransformerImpl.reset(), then the problem seems to be resolved, and I am
able to re-use the same XMLFilter object many times.

I have seem a few other items out on Google speaking of the same issue, and one
poster stated he had this problem even with a simple modification to the
UseXMLFilters sample to run the parse() in a loop; so this should be very easy
to reproduce.  If not, let me know, and I can pass on my code. to Whenever I attempt to re-use an XMLFilter object, I receive the following stack
trace (first use of the XMLFilter was successful, so it doesn't appear to be my
XSL script):

Exception in thread "main" java.lang.RuntimeException:
java.lang.NullPointerException
        at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3364)
        at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:427)
        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.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:191)
        at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:191)
        at transform.Transform.doTransform(Transform.java:298)
        at transform.Transform.doTransform(Transform.java:279)
        at transform.Transform.main(Transform.java:204)

I traced this to the following line in TransformerImpl.applyTemplateToNode():

DTM dtm = m_xcontext.getDTM(child);

This appears to be returning null when the XMLFilter object is being used for
the second time.  If I comment out the:

m_xcontext.reset();

line in TransformerImpl.reset(), then the problem seems to be resolved, and I am
able to re-use the same XMLFilter object many times.

I have seem a few other items out on Google speaking of the same issue, and one
poster stated he had this problem even with a simple modification to the
UseXMLFilters sample to run the parse() in a loop; so this should be very easy
to reproduce.  If not, let me know, and I can pass on my code.
             environment changed from Operating System: Windows NT/2K
Platform: PC to Operating System: Windows NT/2K
Platform: PC
             priority changed to Blocker
             Component changed to SAX
             Component changed from Xalan-interpretive transformation
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/XALANJ-1628?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XALANJ-1628

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XALANJ-1628
    Summary: NullPointerException in TransformerImpl.run() when reusing XMLFilter object
       Type: Bug

     Status: Unassigned
   Priority: Blocker

    Project: XalanJ2
 Components: 
             SAX
   Versions:
             2.5Dx

   Assignee: 
   Reporter: Gretchen Chiaramonte

    Created: Thu, 7 Aug 2003 1:46 PM
    Updated: Sun, 5 Sep 2004 11:30 PM
Environment: Operating System: Windows NT/2K
Platform: PC

Description:
Whenever I attempt to re-use an XMLFilter object, I receive the following stack
trace (first use of the XMLFilter was successful, so it doesn't appear to be my
XSL script):

Exception in thread "main" java.lang.RuntimeException:
java.lang.NullPointerException
        at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3364)
        at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:427)
        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.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:191)
        at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:191)
        at transform.Transform.doTransform(Transform.java:298)
        at transform.Transform.doTransform(Transform.java:279)
        at transform.Transform.main(Transform.java:204)

I traced this to the following line in TransformerImpl.applyTemplateToNode():

DTM dtm = m_xcontext.getDTM(child);

This appears to be returning null when the XMLFilter object is being used for
the second time.  If I comment out the:

m_xcontext.reset();

line in TransformerImpl.reset(), then the problem seems to be resolved, and I am
able to re-use the same XMLFilter object many times.

I have seem a few other items out on Google speaking of the same issue, and one
poster stated he had this problem even with a simple modification to the
UseXMLFilters sample to run the parse() in a loop; so this should be very easy
to reproduce.  If not, let me know, and I can pass on my code.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org