The following issue has been updated:

    Updater: Brian Minchau (mailto:[EMAIL PROTECTED])
       Date: Sat, 4 Sep 2004 9:48 AM
    Changes:
             assignee changed from Xalan Developers Mailing List
             description changed from I am usign JAXP 1.1 Final Release, Xalan v2.0.1 
and Xerces v1.3.1. From the 
JAXP-distribution, only jaxp.jar is used. The actual implementations are from 
the Xalan and Xerces distributions, although the same problem is reproducable 
usign Xalan on the JAXP-distribution.

When Xalan is invoked through JAXP to transform error.xml usign conv.xsl, 
javax.xml.transform.TransformerException is thrown because there is error in 
error.xml. The exception is reported as expected to ErrorListener -instance as 
fatal error. The transformer then finishes normally, but 
org.apache.xalan.transformer.TransformerImpl -thread is left running to a loop 
in org.apache.xalan.stree.Child method getNextSibling, line 312. The JVM will 
never exit because of this (the thread is non-daemon). Some sort of 
notification seems to lack.

The part that is left hanging:
---- org.apache.xalan.stree.Child method getNextSibling, lines 310-317 ---
          while (!m_parent.isComplete())
          {
            m_doc.wait(100);
            throwIfParseError();

            if (null != m_next)
              return m_next;
          }
---- org.apache.xalan.stree.Child method getNextSibling, lines 310-317 ---

The files used:

---- error.xml ----
<INVOICE>
<LINE>
<ITEM>Ruuvi</ITEM><AMOUNT>10.12</AMOUNT>
</LINE>
<LINEaa>
<ITEM>Mutteri</ITEM><AMOUNT>43.42</AMOUNT>
</LINE>
<LINE>
<ITEM>Aluslaatta</ITEM><AMOUNT>0.12</AMOUNT>
</LINE>
</INVOICE>
---- error.xml ----

---- conv.xsl ----
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:output method="text"/>

<xsl:template match="INVOICE">
<xsl:apply-templates select="LINE"/>
</xsl:template>

<xsl:template match="LINE">
<xsl:value-of select="ITEM"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="AMOUNT"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
---- conv.xsl ----

Code fragment that demostrates the execution of Xalan:
---- JAXPTest.java ----
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Source transformerSource = new StreamSource(new File("conv.xsl"));
    Transformer transformer =
      transformerFactory.newTransformer(transformerSource);
    transformer.setErrorListener(this);

    Source input = new StreamSource(new File("error.xml"));
    Result output = new StreamResult(new File("output.txt"));
    transformer.transform(input, output);
---- JAXPTest.java ----

The complete source with JBuilder v4.0 project to demonstrate the problem is 
available upon request (please contact me by email [EMAIL PROTECTED]). to I am usign 
JAXP 1.1 Final Release, Xalan v2.0.1 and Xerces v1.3.1. From the 
JAXP-distribution, only jaxp.jar is used. The actual implementations are from 
the Xalan and Xerces distributions, although the same problem is reproducable 
usign Xalan on the JAXP-distribution.

When Xalan is invoked through JAXP to transform error.xml usign conv.xsl, 
javax.xml.transform.TransformerException is thrown because there is error in 
error.xml. The exception is reported as expected to ErrorListener -instance as 
fatal error. The transformer then finishes normally, but 
org.apache.xalan.transformer.TransformerImpl -thread is left running to a loop 
in org.apache.xalan.stree.Child method getNextSibling, line 312. The JVM will 
never exit because of this (the thread is non-daemon). Some sort of 
notification seems to lack.

The part that is left hanging:
---- org.apache.xalan.stree.Child method getNextSibling, lines 310-317 ---
          while (!m_parent.isComplete())
          {
            m_doc.wait(100);
            throwIfParseError();

            if (null != m_next)
              return m_next;
          }
---- org.apache.xalan.stree.Child method getNextSibling, lines 310-317 ---

The files used:

---- error.xml ----
<INVOICE>
<LINE>
<ITEM>Ruuvi</ITEM><AMOUNT>10.12</AMOUNT>
</LINE>
<LINEaa>
<ITEM>Mutteri</ITEM><AMOUNT>43.42</AMOUNT>
</LINE>
<LINE>
<ITEM>Aluslaatta</ITEM><AMOUNT>0.12</AMOUNT>
</LINE>
</INVOICE>
---- error.xml ----

---- conv.xsl ----
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:output method="text"/>

<xsl:template match="INVOICE">
<xsl:apply-templates select="LINE"/>
</xsl:template>

<xsl:template match="LINE">
<xsl:value-of select="ITEM"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="AMOUNT"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
---- conv.xsl ----

Code fragment that demostrates the execution of Xalan:
---- JAXPTest.java ----
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Source transformerSource = new StreamSource(new File("conv.xsl"));
    Transformer transformer =
      transformerFactory.newTransformer(transformerSource);
    transformer.setErrorListener(this);

    Source input = new StreamSource(new File("error.xml"));
    Result output = new StreamResult(new File("output.txt"));
    transformer.transform(input, output);
---- JAXPTest.java ----

The complete source with JBuilder v4.0 project to demonstrate the problem is 
available upon request (please contact me by email [EMAIL PROTECTED]).
             environment changed from Operating System: All
Platform: PC to Operating System: All
Platform: PC
             priority changed to Blocker
             Component changed to JAXP
             Component changed from Other
    ---------------------------------------------------------------------
For a full history of the issue, see:

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

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

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XALANJ-116
    Summary: Xalan hangs if javax.xml.transform.TransformerException thrown when 
invoked through JAXP
       Type: Bug

     Status: Resolved
   Priority: Blocker
 Resolution: CANNOT REPRODUCE

    Project: XalanJ2
 Components: 
             JAXP
   Versions:
             2.0.1

   Assignee: 
   Reporter: Antti Valtokari

    Created: Tue, 10 Apr 2001 1:10 AM
    Updated: Sat, 4 Sep 2004 9:48 AM
Environment: Operating System: All
Platform: PC

Description:
I am usign JAXP 1.1 Final Release, Xalan v2.0.1 and Xerces v1.3.1. From the 
JAXP-distribution, only jaxp.jar is used. The actual implementations are from 
the Xalan and Xerces distributions, although the same problem is reproducable 
usign Xalan on the JAXP-distribution.

When Xalan is invoked through JAXP to transform error.xml usign conv.xsl, 
javax.xml.transform.TransformerException is thrown because there is error in 
error.xml. The exception is reported as expected to ErrorListener -instance as 
fatal error. The transformer then finishes normally, but 
org.apache.xalan.transformer.TransformerImpl -thread is left running to a loop 
in org.apache.xalan.stree.Child method getNextSibling, line 312. The JVM will 
never exit because of this (the thread is non-daemon). Some sort of 
notification seems to lack.

The part that is left hanging:
---- org.apache.xalan.stree.Child method getNextSibling, lines 310-317 ---
          while (!m_parent.isComplete())
          {
            m_doc.wait(100);
            throwIfParseError();

            if (null != m_next)
              return m_next;
          }
---- org.apache.xalan.stree.Child method getNextSibling, lines 310-317 ---

The files used:

---- error.xml ----
<INVOICE>
<LINE>
<ITEM>Ruuvi</ITEM><AMOUNT>10.12</AMOUNT>
</LINE>
<LINEaa>
<ITEM>Mutteri</ITEM><AMOUNT>43.42</AMOUNT>
</LINE>
<LINE>
<ITEM>Aluslaatta</ITEM><AMOUNT>0.12</AMOUNT>
</LINE>
</INVOICE>
---- error.xml ----

---- conv.xsl ----
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:output method="text"/>

<xsl:template match="INVOICE">
<xsl:apply-templates select="LINE"/>
</xsl:template>

<xsl:template match="LINE">
<xsl:value-of select="ITEM"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="AMOUNT"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
---- conv.xsl ----

Code fragment that demostrates the execution of Xalan:
---- JAXPTest.java ----
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Source transformerSource = new StreamSource(new File("conv.xsl"));
    Transformer transformer =
      transformerFactory.newTransformer(transformerSource);
    transformer.setErrorListener(this);

    Source input = new StreamSource(new File("error.xml"));
    Result output = new StreamResult(new File("output.txt"));
    transformer.transform(input, output);
---- JAXPTest.java ----

The complete source with JBuilder v4.0 project to demonstrate the problem is 
available upon request (please contact me by email [EMAIL PROTECTED]).


---------------------------------------------------------------------
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to