You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Jean-Frederic Clere (JIRA)" <xa...@xml.apache.org> on 2007/04/10 18:17:32 UTC

[jira] Created: (XALANJ-2376) TransformerFactory.newTransformer(source) returns null instead throwing an exception

TransformerFactory.newTransformer(source) returns null instead throwing an exception
------------------------------------------------------------------------------------

                 Key: XALANJ-2376
                 URL: https://issues.apache.org/jira/browse/XALANJ-2376
             Project: XalanJ2
          Issue Type: Bug
          Components: transformation
    Affects Versions: 2.7
         Environment: According to the spec newTransformer() should not return null. That the case with 2.6.0 but not with 2.7.0
            Reporter: Jean-Frederic Clere
            Priority: Blocker


The following code:
+++
     System.out.println("TransformerFactory: " + tf);
     Transformer t = tf.newTransformer(source);
     System.out.println("Transformer: " + t + " Source: " + source);
     t.transform(source, doc);
     } catch (Exception ex) {
       ex.printStackTrace();
     }
+++
throws a null java.lang.NullPointerException with 2.7.0 (at t.transform(source, doc);) and a org.xml.sax.SAXParseException (at Transformer t = tf.newTransformer(source);) in 2.6.0

The problem is located in src/org/apache/xalan/processor/TransformerFactoryImpl.java  m_errorListener is wrongly initialized to DefaultErrorHandler(false)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2376) TransformerFactory.newTransformer(source) returns null instead throwing an exception

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488759 ] 

Henry Zongaro commented on XALANJ-2376:
---------------------------------------

I agree that this is a bug, but is it really a Blocker given that there are simple way to work around the problem?

> TransformerFactory.newTransformer(source) returns null instead throwing an exception
> ------------------------------------------------------------------------------------
>
>                 Key: XALANJ-2376
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2376
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation
>    Affects Versions: 2.7
>         Environment: According to the spec newTransformer() should not return null. That the case with 2.6.0 but not with 2.7.0
>            Reporter: Jean-Frederic Clere
>            Priority: Blocker
>         Attachments: patch.txt
>
>
> The following code:
> +++
>      System.out.println("TransformerFactory: " + tf);
>      Transformer t = tf.newTransformer(source);
>      System.out.println("Transformer: " + t + " Source: " + source);
>      t.transform(source, doc);
>      } catch (Exception ex) {
>        ex.printStackTrace();
>      }
> +++
> throws a null java.lang.NullPointerException with 2.7.0 (at t.transform(source, doc);) and a org.xml.sax.SAXParseException (at Transformer t = tf.newTransformer(source);) in 2.6.0
> The problem is located in src/org/apache/xalan/processor/TransformerFactoryImpl.java  m_errorListener is wrongly initialized to DefaultErrorHandler(false)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2376) TransformerFactory.newTransformer(source) returns null instead throwing an exception

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533734 ] 

Henry Zongaro commented on XALANJ-2376:
---------------------------------------

Yes - setting an ErrorListener on the TransformerFactory instance that will throw a TransformerException in the fatalError method was the simple work-around that I meant.

> TransformerFactory.newTransformer(source) returns null instead throwing an exception
> ------------------------------------------------------------------------------------
>
>                 Key: XALANJ-2376
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2376
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation
>    Affects Versions: 2.7
>         Environment: According to the spec newTransformer() should not return null. That the case with 2.6.0 but not with 2.7.0
>            Reporter: Jean-Frederic Clere
>            Priority: Blocker
>         Attachments: patch.txt
>
>
> The following code:
> +++
>      System.out.println("TransformerFactory: " + tf);
>      Transformer t = tf.newTransformer(source);
>      System.out.println("Transformer: " + t + " Source: " + source);
>      t.transform(source, doc);
>      } catch (Exception ex) {
>        ex.printStackTrace();
>      }
> +++
> throws a null java.lang.NullPointerException with 2.7.0 (at t.transform(source, doc);) and a org.xml.sax.SAXParseException (at Transformer t = tf.newTransformer(source);) in 2.6.0
> The problem is located in src/org/apache/xalan/processor/TransformerFactoryImpl.java  m_errorListener is wrongly initialized to DefaultErrorHandler(false)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2376) TransformerFactory.newTransformer(source) returns null instead throwing an exception

Posted by "Chris Bowditch (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533694 ] 

Chris Bowditch commented on XALANJ-2376:
----------------------------------------

We have just run into this issue. What are the "simple" workarounds you mention?

Setting ErrorListener on TransformerFactory?

> TransformerFactory.newTransformer(source) returns null instead throwing an exception
> ------------------------------------------------------------------------------------
>
>                 Key: XALANJ-2376
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2376
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation
>    Affects Versions: 2.7
>         Environment: According to the spec newTransformer() should not return null. That the case with 2.6.0 but not with 2.7.0
>            Reporter: Jean-Frederic Clere
>            Priority: Blocker
>         Attachments: patch.txt
>
>
> The following code:
> +++
>      System.out.println("TransformerFactory: " + tf);
>      Transformer t = tf.newTransformer(source);
>      System.out.println("Transformer: " + t + " Source: " + source);
>      t.transform(source, doc);
>      } catch (Exception ex) {
>        ex.printStackTrace();
>      }
> +++
> throws a null java.lang.NullPointerException with 2.7.0 (at t.transform(source, doc);) and a org.xml.sax.SAXParseException (at Transformer t = tf.newTransformer(source);) in 2.6.0
> The problem is located in src/org/apache/xalan/processor/TransformerFactoryImpl.java  m_errorListener is wrongly initialized to DefaultErrorHandler(false)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2376) TransformerFactory.newTransformer(source) returns null instead throwing an exception

Posted by "Jean-Frederic Clere (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489319 ] 

Jean-Frederic Clere commented on XALANJ-2376:
---------------------------------------------

We are using xalan in several places changing our code and thrid party codes. Therfore it is not possible to change the java code to work around the problem.

> TransformerFactory.newTransformer(source) returns null instead throwing an exception
> ------------------------------------------------------------------------------------
>
>                 Key: XALANJ-2376
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2376
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation
>    Affects Versions: 2.7
>         Environment: According to the spec newTransformer() should not return null. That the case with 2.6.0 but not with 2.7.0
>            Reporter: Jean-Frederic Clere
>            Priority: Blocker
>         Attachments: patch.txt
>
>
> The following code:
> +++
>      System.out.println("TransformerFactory: " + tf);
>      Transformer t = tf.newTransformer(source);
>      System.out.println("Transformer: " + t + " Source: " + source);
>      t.transform(source, doc);
>      } catch (Exception ex) {
>        ex.printStackTrace();
>      }
> +++
> throws a null java.lang.NullPointerException with 2.7.0 (at t.transform(source, doc);) and a org.xml.sax.SAXParseException (at Transformer t = tf.newTransformer(source);) in 2.6.0
> The problem is located in src/org/apache/xalan/processor/TransformerFactoryImpl.java  m_errorListener is wrongly initialized to DefaultErrorHandler(false)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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