Page 1 of 1

Docx4j dependencies - Xalan, commons-vfs

PostPosted: Fri Nov 12, 2010 8:58 pm
by alla
According to Getting Started guide the Xalan JAR is only required for HTML and PDF export. I am not using either, however I get a runtime exception when calling XmlUtils.deepCopy():

Exception in thread "Thread-5" javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:106)
at org.docx4j.XmlUtils.setTFactory(XmlUtils.java:127)
at org.docx4j.XmlUtils.<clinit>(XmlUtils.java:101)

If I add xalan-patched-2.7.0.jar, deepCopy starts working without throwing any exceptions.

Getting Started says that Commons-VFS is needed for "Saving/loading via WebDAV etc". But it appears that it is used by WordprocessingMLPackage.load(). If I remove the jar, the following exception is thrown:

Exception in thread "Thread-5" java.lang.NoClassDefFoundError: org/apache/commons/vfs/FileSystemException
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:179)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:163)

It's not a big problem as such, but perhaps the documentation should be updated. Ideally, of course, I'd have as few external dependencies as possible. :)

Regards,
Alla

Re: Docx4j dependencies - Xalan, commons-vfs

PostPosted: Sat Nov 13, 2010 10:31 am
by jason
Hi Alla, thanks for taking the time to point that out. cheers .. Jason