Hi! I want to process XSL-FO generated from XML using XSLT 2.0. So i use Saxon-8.8 for the transformation. With Fop-0.91 it works fine. But when i use Version 0.92 or 0.93 an IllegalStateException encountered (see stack below). Regards Jörg java.lang.IllegalStateException: FOTreeBuilder (and the Fop class) cannot be reused. Please instantiate a new instance. at org.apache.fop.fo.FOTreeBuilder.startDocument(FOTreeBuilder.java:147) at net.sf.saxon.event.ContentHandlerProxy.open(ContentHandlerProxy.java:242) at net.sf.saxon.event.ProxyReceiver.open(ProxyReceiver.java:76) at net.sf.saxon.event.ImplicitResultChecker.open(ImplicitResultChecker.java:24) at net.sf.saxon.event.ImplicitResultChecker.firstContent(ImplicitResultChecker.java:59) at net.sf.saxon.event.ImplicitResultChecker.startElement(ImplicitResultChecker.java:30) at net.sf.saxon.event.NamespaceReducer.startElement(NamespaceReducer.java:54) at net.sf.saxon.event.ComplexContentOutputter.startContent(ComplexContentOutputter.java:481) at net.sf.saxon.event.ComplexContentOutputter.startElement(ComplexContentOutputter.java:153) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:243) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:353) at net.sf.saxon.instruct.Instruction.process(Instruction.java:91) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:250) at net.sf.saxon.instruct.Template.expand(Template.java:113) at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:375) at net.sf.saxon.Controller.transformDocument(Controller.java:1607) at net.sf.saxon.Controller.transform(Controller.java:1426)
How are you running FOP? From the command line or via an embedded application? The API has changed since 0.91. Have you read? http://xmlgraphics.apache.org/fop/0.93/upgrading.html
As well as. I have change the fop.bat to add saxon-8.8.0.jar to use XSLT 2.0 I have notice, that the FOTreeBuilder has changed from 0.91 to 0.92 He cannot be reused since 0.92. (See FOTreeBuilder#startDocument(): public void startDocument() throws SAXException { if (used) { throw new IllegalStateException("FOTreeBuilder (and the Fop class) cannot be reused." + " Please instantiate a new instance."); } used = true; rootFObj = null; // allows FOTreeBuilder to be reused if (log.isDebugEnabled()) { .... ) But it seems, that Saxon calls #startDocument() once again.
(In reply to comment #2) > As well as. I don't understand this remark. > But it seems, that Saxon calls #startDocument() once again. Well then isn't the fault with Saxon. startDocument event should only be called once! Have you asked why startDocument event is generated twice on a Saxon users list? I'll leave this bug open for now.
Hi, > But when i use Version 0.92 or 0.93 > an IllegalStateException encountered (see stack below). <snip /> > java.lang.IllegalStateException: FOTreeBuilder (and the Fop class) cannot be > reused. Please instantiate a new instance. I'm wondering whether FOP can be any clearer than this? It seems that the Fop class is being used for multiple runs (which, IIC, was perfectly possible with 0.91)... Doesn't look like a bug to me.
I had the same problem with saxon 8.8 and fop 93. Then i have changed to saxonb8-7-1j (http://downloads.sourceforge.net/saxon/saxonb8-7-1j.zip?modtime=1144880744&big_mirror=0). I works absolute perfectly now! So it seems that it's rather a problem with saxon 8.8, not fop.
batch transition to closed remaining pre-FOP1.0 resolved bugs