On 02.02.2007 01:09:06 Jeff Vannest wrote:
> I've embedded FOP 0.93 in an Oracle AS 10g (9.0.4) Reports pluggable
> destination, which itself is implemented as a J2EE application. Therefore,
> FOP is called as part of the already-running J2EE environment.
> The problem that I'm having is that the Oracle XML parser blows chunks and
> won't properly parse documents in order for FOP to work correctly. I have
> everything working properly as long as I put Xerces and Xml-apis in the
> pre-boot class path (e.g. "-Xbootclasspath^/p:...") and specifying Xalan as
> the TransformFactory (e.g. "...
> -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.Transfor
> merFactoryImpl).
> However, although this configuration works perfectly, Oracle has
> specifically declared that it will not be supported. Basically if
> Xerces/Xalan ever blows up Oracle Reports, our enterprise's million dollar
> support contract is worthless.

If you look how many more problems Oracle produces than Xerces/Xalan on
our user mailing list, I'd rather be worried that the Oracle XML
libraries cost you the million dollar contract rather than Xerces/Xalan.
;-) It's a simple fact that Oracle's XML code has some nasty very
long-standing bugs. Many people fixed their problems by switching the
JAXP implementation and it seems it is what you had to do, too.

Obviously, the best way would be to have Oracle fix their bugs. It feels
like the weakest of the parties has to work around the problems. I
wonder if anyone has ever bothered to file those bugs with Oracle. Just

> Soooooooooooo...  Question: Is there any other way to force FOP to use the
> Xalan transformer factory without overriding it for the entire Oracle
> Reports application? I may even be allowed the time and resources to create
> a FOP patch in order to make this modification if required.

Not at the moment, but I guess it's not a bad idea. We could create a
factory class that serves as the global creator for all
(SAX)TransformerFactory and SAXParserFactory instances within FOP. If
noone sets anything special we use the default implementation or else
you could set the class names there. I don't think it is easily possible
to do this in FopFactory but doing this in a global way in this
particular case doesn't seem bad to me. The only problem I see is that
we need to keep some degree of discipline throughout the code to get the
factory through that class instead of getting the default JAXP factory.

Something like:

public class FopJAXPFactory {
    public SAXTransformerFactory newSAXTransformerFactory() {...
    public TransformerFactory newTransformerFactory() {...
    public SAXParserFactory newSAXParserFactory() {...

    public void setTransformerFactory(String className) {...
    public void setSAXParserFactory(String className) {...

Optionally, two FOP-specific system properties for the
(SAX)TransformerFactory and the SAXParserFactory.

Or maybe we should call the class FopWorksAroundOracleBugsJAXPFactory.
hehe. Sorry, I couldn't help it.

What does everyone think? 

> As always, thank you in advance for your thoughts.
> Jeff

Jeremias Maerki

Reply via email to