- Code: Select all
ERROR: XmlUtils: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found (XmlUtils.java, line 131)
However, the file parses fine, but what is this dependency about? If I do add xalan-2.7.1.jar I can read the file without errors occuring, but the save method throws a no class found exception:
- Code: Select all
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:823)
at org.docx4j.model.datastorage.CustomXmlDataStorageImpl.writeDocument(CustomXmlDataStorageImpl.java:84)
at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:212)
at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:188)
at org.docx4j.openpackaging.io.SaveToZipFile.savePart(SaveToZipFile.java:362)
at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:325)
at org.docx4j.openpackaging.io.SaveToZipFile.savePart(SaveToZipFile.java:377)
at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:325)
at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:158)
at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:99)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.save(WordprocessingMLPackage.java:204)
at javaapplication1.Docxtest.export(Docxtest.java:223)
at javaapplication1.Docxtest.main(Docxtest.java:193)
Caused by: java.lang.ClassNotFoundException: org.apache.xml.serializer.TreeWalker
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 13 more
So it seems that docx4j has additional dependencies compared to the getting started, AND the lib itself that comes with is corrupt? Thoughts on this? It really works fine just ignoring the library, but I dislike getting random errors.