You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jeff Sese <js...@asiatype.com> on 2007/02/06 05:04:48 UTC

Error in Running FOP 0.93

Hi,

I'm trying out FOP 0.93 using the command-line and my input is an FO
file. However I got this error message when I tried running it:

SEVERE: Exception
java.lang.IllegalStateException: FOTreeBuilder (and the Fop class)
cannot be reused. Please instantiate a new instance.
        at 
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)
---------
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.ReceivingContentHandler.startDocument(ReceivingContentHandler.java:145)
        at
org.apache.xerces.parsers.AbstractSAXParser.startDocument(Unknown Source)
        at
org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
        at
org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:269)
        at net.sf.saxon.event.Sender.send(Sender.java:144)
        at
net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
        at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)

After googling for some related problems, users list the same problem
when running a transformation using saxon, but in my case i did not run
a transformation and have a FO file as input for FOP.

I'm running FOP in a JRE 1.5.0_09 in a Windows XP.

Also when i tried using FOP 0.20.5, i was able to create a PDF output.

How can i resolve this problem?

TIA
-- 
*Jeff Sese*


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Error in Running FOP 0.93

Posted by Chris Bowditch <bo...@hotmail.com>.
Jeff Sese wrote:

> Hi,
> 
> I'm trying out FOP 0.93 using the command-line and my input is an FO
> file. However I got this error message when I tried running it:
> 
> SEVERE: Exception
> java.lang.IllegalStateException: FOTreeBuilder (and the Fop class)
> cannot be reused. Please instantiate a new instance.
>        at 
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
>        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
>        at org.apache.fop.cli.Main.startFOP(Main.java:160)
>        at org.apache.fop.cli.Main.main(Main.java:191)

<snip/>

> After googling for some related problems, users list the same problem
> when running a transformation using saxon, but in my case i did not run
> a transformation and have a FO file as input for FOP.
> 
> I'm running FOP in a JRE 1.5.0_09 in a Windows XP.
> 
> Also when i tried using FOP 0.20.5, i was able to create a PDF output.
> 
> How can i resolve this problem?

This problem is caused by using an older version of Xalan, which has a 
bug that generates 2 end element SAX Events. JDK 1.5 includes a version 
of Xalan in its boot classpath, so you may not realise you are using an 
older version! The only way to override the one in the JDK is by using 
the endorsed mechanism. Basically look for the directory:

JDK150/jre/lib/endorsed

Create the dir if it doesn't exist and then place the xerces and xalan 
JARs from the FOP distribution into the endorsed directory;

xml-apis-1.3.02.jar
xercesImpl-2.7.1.jar
xalan-2.7.0.jar
serializer-2.7.0.jar

Chris






---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org