I've done some experiments based on our discussion. I removed Xerces and
serializer.jar and moved Xalan-J to a test/lib directory and made it
available only to the test code. Building FOP like this is no problem
but running the test suite on a basic Sun JDK 1.4.2_16 (with no replaced
XML JARs) fails:
Testsuite: org.apache.fop.layoutengine.LayoutEngineTestSuite
Tests run: 7, Failures: 0, Errors: 1, Time elapsed: 3.547 sec
------------- Standard Error -----------------
<snip/>
------------- ---------------- ---------------
Testcase: block_hyphenation-ladder-count.xml took 1.375 sec
Testcase: block_hyphenation_kerning.xml took 0.094 sec
Testcase: block_hyphenation_no-wrap.xml took 0.031 sec
Testcase: block_uax14_linebreaking_hyph.xml took 0.016 sec
Caused an ERROR
Dokumentwurzelelement fehlt
org.xml.sax.SAXParseException: Dokumentwurzelelement fehlt
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3376)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3364)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:668)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:151)
at
org.apache.fop.layoutengine.LayoutEngineTester.runTest(LayoutEngineTester.java:139)
at
org.apache.fop.layoutengine.LayoutEngineTestSuite$LayoutEngineTestCase.testMain(LayoutEngineTestSuite.java:214)
at
org.apache.fop.layoutengine.LayoutEngineTestSuite$1.runTest(LayoutEngineTestSuite.java:193)
Testcase: footnote_in_inline.xml took 0.031 sec
Testcase: inline_border_padding_hyphenate.xml took 1.297 sec
Testcase: inline_border_padding_hyphenate_de.xml took 0.672 sec
"Dokumentwurzelelement fehlt" translates to "Document root element
is missing". Probably a bug in Crimson.
Even worse on Sun JDK 1.5.0_14 and 6.0_03:
[junit] Testcase:
test_fonts_directory_recursive.xconf(org.apache.fop.config.FontsDirectoryRecursiveTestCase):
Caused an ERROR
[junit] org/apache/xml/serializer/TreeWalker
[junit] java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
[junit] at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:823)
[junit] at
org.apache.fop.render.pdf.BasePDFTestCase.convertFO(BasePDFTestCase.java:88)
[junit] at
org.apache.fop.config.BaseUserConfigTestCase.convertFO(BaseUserConfigTestCase.java:71)
[junit] at
org.apache.fop.config.BaseConstructiveUserConfigTestCase.testUserConfig(BaseConstructiveUserConfigTestCase.java:38)
[junit]
and...
junit-layout-standard:
[echo] Running standard layout engine tests
[junit] Testsuite: org.apache.fop.layoutengine.LayoutEngineTestSuite
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit]
[junit] Null Test: Caused an ERROR
[junit] null
[junit] java.lang.reflect.InvocationTargetException
[junit] Caused by: java.lang.NoClassDefFoundError:
org/apache/xml/serializer/ExtendedContentHandler
[junit] at
org.apache.xalan.processor.XSLTSchema.build(XSLTSchema.java:325)
[junit] at
org.apache.xalan.processor.XSLTSchema.<init>(XSLTSchema.java:72)
[junit] at
org.apache.xalan.processor.StylesheetHandler.<init>(StylesheetHandler.java:1290)
[junit] at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplatesHandler(TransformerFactoryImpl.java:376)
[junit] at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:867)
[junit] at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:776)
[junit] at
org.apache.fop.layoutengine.LayoutEngineTestSuite.readDisabledTestcases(LayoutEngineTestSuite.java:71)
[junit] at
org.apache.fop.layoutengine.LayoutEngineTestSuite.decorateWithDisabledList(LayoutEngineTestSuite.java:122)
[junit] at
org.apache.fop.layoutengine.LayoutEngineTestSuite.getTestFiles(LayoutEngineTestSuite.java:146)
[junit] at
org.apache.fop.layoutengine.LayoutEngineTestSuite.suite(LayoutEngineTestSuite.java:174)
[junit]
[junit]
[junit] Test org.apache.fop.layoutengine.LayoutEngineTestSuite FAILED
which may a side effect of our using the ASF-built xml-apis.jar which
has a fallback to org.apache.xalan.processor.TransformerFactoryImpl for
the TransformerFactory. Why the fallback is triggered eludes me.
At least, restoring serializer.jar to the test/lib directory lets the
test suite pass on Java 5 and 6. So we're back to only one JAR that can
be removed and that would actually be useful in a Java 1.4 context which
we'll use to build the release.
I want FOP to build out-of-the-box without the user having to fiddle
around with his system (if he has Ant properly installed which can be
assumed today). A newbie needs a "quick success" when he downloads FOP
for the first time. I usually throw new software I try out away if I
cannot build from the sources within 10 minutes. Usually happens with
Maven-built software but not exclusively. Basically, I'm back with my
original solution 2 (<fop-root>/lib/endorsed, no JAR removal) or status
quo.
Did I miss anything?
Jeremias Maerki