I'm using docx4j 2.5.0 to write some docx files and it's working great!
Now I want to convert these files to Pdf and I'm getting this error:
- Code: Select all
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/bind/marshaller/NamespacePrefixMapper
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.docx4j.XmlUtils.JAXBElementDebug(XmlUtils.java:180)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.traverseMainDocumentRecursive(MainDocumentPart.java:530)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.traverseMainDocumentRecursive(MainDocumentPart.java:479)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.traverseMainDocumentRecursive(MainDocumentPart.java:450)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.fontsInUse(MainDocumentPart.java:325)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.setFontMapper(WordprocessingMLPackage.java:323)
at spt.Main.main(Main.java:63)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.marshaller.NamespacePrefixMapper
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 19 more
I'm using Eclipse helios, JDK 1.6.0_20.
I've read on another thread that I should download a JAXB RI and put it my endorsed libs dir, but I don't know how to do it.
Anyone can help me?
Heitor