Thursday 26 January 2012

I had to transform an Apache FOP file to PDF and got the following error running on Weblogic:
XML-22900: (Fatal Error) An internal error condition occurred.
<Servlet> <convertFO2PDF>
javax.xml.transform.TransformerException: XML-22900: (Fatal Error) An internal error condition occurred.
    at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:915)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:502)


The way to fix it is to explicitly make use of the Xalan XML Transformer Factory. Otherwise, the Oracle implementation gets used and hence the above error. Due to the fact that Apache FOP requires the Xalan Transformer Factory it fixes the problem.

This is how I did it:
TransformerFactory factory = new org.apache.xalan.processor.TransformerFactoryImpl();

All this resulted in :-)

1 comment:

  1. Wow thats amazing. As I am familiar with Saxon, I used saxon transformer instead of Xalan and that worked like charm.

    This line worked for me:
    TransformerFactory factory = new net.sf.saxon.TransformerFactoryImpl();

    ReplyDelete