You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Henry Zongaro (JIRA)" <xa...@xml.apache.org> on 2004/11/10 16:16:25 UTC

[jira] Commented: (XALANJ-1988) Core dump: Sun Hotspot JVM 1.3.1_11b-02 optimizer core dumps optimizing a Xalan

     [ http://nagoya.apache.org/jira/browse/XALANJ-1988?page=comments#action_55305 ]
     
Henry Zongaro commented on XALANJ-1988:
---------------------------------------

Your usage of Templates and Transformer looks correct.

I'm not really sure why this pair of bug reports has been opened against Xalan-Java.  We don't have much information to go on.  I'm not aware of any bugs in Xalan-J that are liable to cause a JIT optimizer to crash.

> Core dump: Sun Hotspot JVM 1.3.1_11b-02 optimizer core dumps optimizing a Xalan
> -------------------------------------------------------------------------------
>
>          Key: XALANJ-1988
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-1988
>      Project: XalanJ2
>         Type: Bug
>   Components: transformation
>     Versions: 2.4Dx
>  Environment: Sun Sparc Workstation Netra-T4, Solaris 5.9, Sun Hotspot JVM 1.3.1_11-b02 (Optimization ON), BEA Weblogic 7.0 SP4 running Java Webapps (no JNI/native code), XalanJ2 (Implementation version 2.4.D1)
>     Reporter: SAUVAGEAU Eric

>
> I just added this issue to complete the problem reported by Manish.
> In fact we are using XALAN this way :
>     Transformer transformer = getTransformer(xslSource);
>     transformer.setOutputProperty(OutputKeys.ENCODING, sEncoding);
>     ByteArrayOutputStream baos = new ByteArrayOutputStream();
>     StreamResult mlResult = new StreamResult(baos);
>     StreamSource xmlStreamSource = new StreamSource(xmlSource.toStringReader());
>     transformer.transform(xmlStreamSource, mlResult);
>   
> the method getTransformer is like this :
>  protected Transformer getTransformer(BDataXsl dataXsl) throws ExTransformerException
>  {
>    Transformer transformer = null;
>    if (dataXsl != null) {
>      // try to get it from cache
>      String sKey = dataXsl.getKey();
>      Templates translet = (Templates) _dataFactory.getCacheData(sKey);
>      // do we have a transformer
>      if (translet == null) {
>       try {
> 	StreamSource xslStreamSource = new StreamSource(dataXsl.toStringReader());
> 	xslStreamSource.setSystemId(dataXsl.getFileName());
> 	translet = _transformerFactory.newTemplates(xslStreamSource);
> 	transformer = translet.newTransformer();
>       }
>       catch (TransformerConfigurationException ex) {
>         // code omitted for clarity
>       }
>     }
>     else {
>      try {
> 	transformer = translet.newTransformer();
>      }
>      catch (TransformerConfigurationException ex) {
>        // code omitted for clarity
>      }
>     }
>    }
>    // code omitted for clarity
> My inderstanding is that Templates are thread safe and transformer are not but do you see any bad stuff in this code ?
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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