My app will compile and run, but when I go to use the docx4j part, it gives me a NoClassDefFoundError,
- Code: Select all
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/sun/istack/FinalArrayList;
at ae.com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:197)
at java.lang.reflect.Method.invoke(Native Method)
at ae.javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186)
at ae.javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146)
at ae.javax.xml.bind.ContextFinder.find(ContextFinder.java:348)
at ae.javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
at ae.javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
at org.docx4j.jaxb.NamespacePrefixMapperUtils.getPrefixMapper(NamespacePrefixMapperUtils.java:47)
at org.docx4j.jaxb.Context.<clinit>(Context.java:67)
The line in my code that triggers this is
- Code: Select all
ObjectFactory factory = Context.getWmlObjectFactory();
So it looks like the jaxb component is tied into a datatype that is only part of sun's java libraries. I am using ae-jaxb-2.2.5.jar, and I successfully resolved a previous ClassDefNotFound for log4j by installing that jar.
I attempted to see if any of the special dependencies for docx4j contained this sun FinalArrayList, but it doesn't appear that way. What should I do ?
Thanks