You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jeremias Maerki <de...@jeremias-maerki.ch> on 2008/02/19 22:45:01 UTC

Update: XML JARs

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


Re: Update: XML JARs

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 20.02.2008 12:37:42 Vincent Hennebert wrote:
> I get the same kind of errors on my Linux box. I don’t understand why 
> the error under Java 1.4 does not occur when xercesImpl.jar is added to 
> the classpath, since AFAIK we don’t trigger the endorsed mechanism, so 
> the default SAX parser implementation shipped with Java should not be 
> overridden.
> 
> I guess the simplest is to keep with the status quo, or with your 
> solution #2 if you feel like implementing it.

I actually prefer #2 if we start using JAXP 1.3 features like XInclude.
I would volunteer to implement #2 including writing additional docs.

> However, I would put only 
> serializer and xercesImpl in the endorsed/ directory, since like 
> I explained [1] I’d consider the other two as regular dependencies 
> (classes not available in the standard library).

But not putting xml-apis.jar into the endorsed directory makes the
classpath setup more complicated and unintuitive. You'd have to put JARs
from the lib and lib/endorsed dirs into the bootclasspath and you cannot
use *.jar in Ant without additional exclude statements.

> (That said, newbies will probably download the binaries instead of 
> having to fiddle with the source files.)

Definitely. And not even newbies.

> Vincent
> 
> [1] http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200801.mbox/%3c47A1E858.6050406@anyware-tech.com%3e
> 
> Jeremias Maerki wrote:
> > 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
> > 
> 
> -- 
> Vincent Hennebert                            Anyware Technologies
> http://people.apache.org/~vhennebert         http://www.anyware-tech.com
> Apache FOP Committer                         FOP Development/Consulting




Jeremias Maerki


Re: Update: XML JARs

Posted by Simon Pepping <sp...@leverkruid.eu>.
On Wed, Feb 20, 2008 at 11:37:42AM +0000, Vincent Hennebert wrote:
> I get the same kind of errors on my Linux box. I don???t understand why 
> the error under Java 1.4 does not occur when xercesImpl.jar is added to 
> the classpath, since AFAIK we don???t trigger the endorsed mechanism, so 
> the default SAX parser implementation shipped with Java should not be 
> overridden.

Probably due to the services directory in xercesImpl.jar, which points
to Xerces as the SAXParserFactory implementation.

Simon

-- 
Simon Pepping
home page: http://www.leverkruid.eu

Re: Update: XML JARs

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
I get the same kind of errors on my Linux box. I don’t understand why 
the error under Java 1.4 does not occur when xercesImpl.jar is added to 
the classpath, since AFAIK we don’t trigger the endorsed mechanism, so 
the default SAX parser implementation shipped with Java should not be 
overridden.

I guess the simplest is to keep with the status quo, or with your 
solution #2 if you feel like implementing it. However, I would put only 
serializer and xercesImpl in the endorsed/ directory, since like 
I explained [1] I’d consider the other two as regular dependencies 
(classes not available in the standard library).

(That said, newbies will probably download the binaries instead of 
having to fiddle with the source files.)

Vincent

[1] http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200801.mbox/%3c47A1E858.6050406@anyware-tech.com%3e

Jeremias Maerki wrote:
> 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
> 

-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting