IBM Support

PK12374: JAVAX.XML.TRANSFORM.TRANSFORMERCONFIGURATIONEXCEPTION OCCURS WHEN EXECUTING AN XSLT TRANSFORM IN JVM DEBUG MODE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Problem:  Applications that use a DOMSource and perform an XSL
    transformation cannot be run in debug mode.  As the sample
    application
    that was previously submitted demonstrates, the application
    works
    absolutely perfectly when started normally, but fails to execute
    when
    started in debug mode.  Enough said -- working applications
    should not
    
    Using any basic XML/XSL transformation, the error is thrown when
    the following line is executed:
    transformer = TransformerFactory.newInstance().newTransformer
    (mydomsource);
    .
    Error message is:
    "javax.xml.transform.TransformerConfigurationException:
    Parsing by the XSLT debugger failed because the stylesheet, a
    javax.xml.transform.dom.DOMSource object,
    passed to javax.xml.transform.TransformerFactory.newTemplates()
    did not have its SystemId set."
    .
    This message is being thrown by the IBM class:
    "com.ibm.debug.xdi.jaxp.xalan.interpreted.DebugTransformerFactor
    y.newTemplates(DebugTransformerFactory.java:292"
    
    Another possible symptom of this problem is
    We have observed two different
    exceptions (only during debugging):
    
    Caused by: java.lang.ClassCastException:
    com.ibm.debug.xdi.jaxp.xalan.interpreted.DebugTransformerFactory
    at javax.xml.transform.TransformerFactory.newInstance(Unknown
    Source)
    at
    org.apache.cocoon.serialization.AbstractTextSerializer.configure
    (Abstrac
    tTextSerializer.java:259)
    at
    org.apache.cocoon.serialization.HTMLSerializer.configure(HTMLSer
    ializer.
    java:53)
    at
    org.apache.avalon.framework.container.ContainerUtil.configure(Co
    ntainerU
    til.java:240)
    ...
    After changing xml implementation and xalan jars we still get
    the
    following:
    [18.11.05 10:48:49:135 CET] 00000034 SystemOut O 2005-11-18
    10:48:49,125 ERROR [sitemap.transformer.componentstransformer]
    Exception encountered while widget-transforming the document!
    javax.xml.transform.TransformerException:
    org.apache.xml.utils.WrappedRuntimeException:
    org.apache.xml.serializer.ToXMLSAXHandler
    Cause:  The root cause of this problem has to do with the
    TransformerFactory that is used.  When started normally,
    calling the "TransformerFactory.newInstance()" method returns
    an instance of
    "org.apache.xalan.processor.TransformerFactoryImpl" -- and
    this works fine.
       However, when started in debug mode, the
    "TransformerFactory.newInstance()" method
    returns an instance of
    "com.ibm.debug.xdi.jaxp.xalan.interpreted.DebugTr
    ansformerFactory" -- which causes this problem to occur.
    

Local fix

  • There are several ways to work around around this issue.
    
    WORK AROUND #1: Disable the DebugTransformer in your server.
    This is the best option if you do not plan to use the
    XSLT Debugger in Rational Application Developer.  There are two
    methods to disable the DebugTransformer:
    
    Method #1  Setting a JVM system property in the WebSphere
    Administrative Console:
     a) Log in to your WebSphere Administrative Console.
     b) Navigate to Servers -> Application Servers and select
        your server.
     c) In the Additional Properties section, select
        Debugging Service.
     d) Add the following parameter to your JVM debug arguments:
          -Dcom.ibm.debug.attach.agent.xslt.enabled=false
    
    Method #2: Setting a JVM system property programmatically in
    your code:
     a) Edit your code and add the following line before
    retrieving a transformer from the Transformer Factory:
      System.setProperty(
         "javax.xml.transform.TransformerFactory",
         "org.apache.xalan.processor.TransformerFactoryImpl");
    
    
    WORK AROUND #2: Programmatically set the SystemID for your
    DOMSource.  The following code snippet shows how to explicitly
    set the SystemID for your DOMSource:
    
      //Code to create your DOMSource:
      javax.xml.transform.dom.DOMSource myDOMSource;
      javax.xml.transform.TransformerFactory factory;
      javax.xml.transform.Transformer transformer;
      myDOMSource = ... //Code that creates your DOMSource
    
      // The next line explicitly sets the SystemID:
      myDOMSource.setSystemId("http://mycompany.org/mydomsource");
    
      //Then create your transformer:
      factory =
        javax.xml.transform.TransformerFactory.newInstance();
      transformer = factory.newTransformer(myDOMSource);
    
    
    WORK AROUND #3:. Use SAXSource/StreamSource instead of DOMSource
    Depending on how your application is designed you may be able to
    work around this issue by using one of the following source
    types:
      - javax.xml.transform.sax.SAXSource
      - java.xml.transform.stream.StreamSource
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: WebSphere Application Server users running   *
    *                 the server in debug mode, with               *
    *                 applications that invoke XSL transforms.     *
    ****************************************************************
    * PROBLEM DESCRIPTION: XSL Transformations (with no system     *
    *                      ID) fail in Debug Mode                  *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When running WebSphere Application Server version 6.0 in Debug
    Mode, the DebugTransformer that processes XSL Transformations
    is unable to handle XML without a systemID set. An exception
    occurs that is similar to the following:
    
    "javax.xml.transform.TransformerConfigurationException:
    Parsing by the XSLT debugger failed because the stylesheet, a
    javax.xml.transform.dom.DOMSource object, passed to
    javax.xml.transform.TransformerFactory.newTemplates() did not
    have its SystemId set."
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PK12374

  • Reported component name

    WEBSPH APP SERV

  • Reported component ID

    5724J0800

  • Reported release

    60W

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2005-09-23

  • Closed date

    2005-11-21

  • Last modified date

    2007-05-23

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Modules/Macros

  • ENGINE
    

Fix information

  • Fixed component name

    WEBSPH APP SERV

  • Fixed component ID

    5724J0800

Applicable component levels

  • R60A PSY

       UP

  • R60H PSY

       UP

  • R60I PSY

       UP

  • R60P PSY

       UP

  • R60S PSY

       UP

  • R60W PSY

       UP

  • R60Z PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
10 February 2022