Problems With FOP in Linux

"Steve Baker" <[email protected]> Fri, 5 Mar 2004 11:54:01 -0000
Newsgroups gmane.comp.krysalis.user
Message-ID <[email protected]>
I've been struggling with the installation of version 1.0beta in a Linux
environment, using fop 0.20.5rc2 for the last couple of days.

I've copied the following files to the Fop /build directory:
krysalis-barcode-fop-ext-0.20.5.jar
krysalis-barcode.jar

I've copied the following files to the Fop /lib directory:
avalon-framework-4.1.4.jar
commons-cli-1.0.jar
jdom.jar
saxon-6.5.3.jar
servlet-2.2.jar
xalan-2.4.1.jar
xercesImpl-2.2.1.jar
xml-apis.jar

I've moved the old avalon file out of the Fop /lib directory:
avalon-framework-cvs-20020806.jar

I've added the new files to the classpath in fop.sh, so that it is now set
to:
./lib/xml-apis.jar:
./lib/xercesImpl-2.2.1.jar:
./lib/xalan-2.4.1.jar:
./lib/servlet-2.2.jar:
./lib/saxon-6.5.3.jar:
./lib/jdom.jar:
./lib/commons-cli-1.0.jar:
./lib/batik.jar:
./lib/avalon-framework-4.1.4.jar:
./build/fop.jar:
./build/krysalis-barcode-fop-ext-0.20.5.jar:
./build/krysalis-barcode.jar:

However, when I try to run the example fop script, I get the following
output:
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] FOP 0.20.5rc2
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
Exception in thread "main" java.lang.AbstractMethodError
        at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:255)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.fop.apps.Driver.render(Driver.java:457)
        at
org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:69)
        at org.apache.fop.apps.Fop.main(Fop.java:19)


I also modified one of my own XSL documents to include the example Fop
snippet:
<fo:block>
  <fo:instream-foreign-object>
    <barcode:barcode xmlns:barcode="http://www.krysalis.org/barcode/ns"
          msg="my message">
      <barcode:code39>
        <barcode:height>8mm</barcode:height>
      </barcode:code39>
    </barcode:barcode>
  </fo:instream-foreign-object>
</fo:block>

But this also fails:
# ./fop.sh -xml ./invoice.xml -xsl ./inv_stylesheet.xsl ./invoice.pdf

[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] FOP 0.20.5rc2
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
Exception in thread "main" java.lang.AbstractMethodError
        at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:255)
        at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.j
ava:856)
        at
org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandle
r.java:931)
        at
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.
java:306)
        at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
684)
        at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2182)
        at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2008)
        at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1171)
        at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3135)
        at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH
andlerImpl.java:433)
        at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown
Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown
Source)
        at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
        at
org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(Unknown Source)
        at
org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatc
h(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at
org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134)
        at org.apache.fop.apps.Driver.render(Driver.java:457)
        at
org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:69)
        at org.apache.fop.apps.Fop.main(Fop.java:19)

If I remove the snippet, the transformation works again.


Any pointers or suggestions would be MUCH appreciated.

Best regards,
Steve



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click