Bug 41376 - FOTreeBuilder throws IllegalStateException
Summary: FOTreeBuilder throws IllegalStateException
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fo tree (show other bugs)
Version: 0.92
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-16 03:20 UTC by Joerg Schroeder
Modified: 2012-04-01 13:55 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Schroeder 2007-01-16 03:20:12 UTC
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)
Comment 1 Chris Bowditch 2007-01-16 06:10:34 UTC
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
Comment 2 Joerg Schroeder 2007-01-16 07:42:13 UTC
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.
Comment 3 Chris Bowditch 2007-01-16 07:58:47 UTC
(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.

Comment 4 Andreas L. Delmelle 2007-01-16 09:50:23 UTC
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.
Comment 5 Thorsten 2007-01-26 06:21:06 UTC
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.
Comment 6 Glenn Adams 2012-04-01 13:55:25 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs