I've been obtaining a ClassNotFound error, in a semi-random manner when I try to run a docx to pdf conversion using docx4j.
I'm deploying my app in a weblogic 10.3.5, and the exception is trown at runtime. And i'm using maven to handle the dependencies, the docx4j version is 3.0.0.
The weblogic.xml is reflecting the directive to prefer app jar uppon the weblogic ones. (I've tried to declered the preferences by package but Weblogic doesn't seem to manage the references to the antlr.* package properly, so my app using hibernate, then completely fails).
- Code: Select all
<wls:container-descriptor>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
The jar serializer-2.7.1.jar is correctly present in WEB-INf/lib of the app (all required jars are present in WEB-INF/lib xalan, etc).
I'm going crazy with this error, and can't figure out what i'm missing. The error has become more frequen, but it doesn't happen everytime, is semi-random. Seems to be a classloader issue, and the order that weblogic applies to the loading of the jars seems to affect to create or not the error.
¿Any clue?
- Code: Select all
Caused by: java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:389)
at com.sun.xml.bind.v2.runtime.XMLSerializer.writeDom(XMLSerializer.java:808)
at com.sun.xml.bind.v2.runtime.property.ArrayReferenceNodeProperty.serializeListBody(ArrayReferenceNodeProperty.java:112)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:332)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:699)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:332)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:593)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:320)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:110)
at org.docx4j.XmlUtils.marshaltoW3CDomDocument(XmlUtils.java:642)
at org.docx4j.convert.out.common.WmlXsltExporterDelegate.getSourceDocument(WmlXsltExporterDelegate.java:48)
at org.docx4j.convert.out.common.AbstractXsltExporterDelegate.process(AbstractXsltExporterDelegate.java:56)
at org.docx4j.convert.out.common.AbstractWmlExporter.process(AbstractWmlExporter.java:63)
at org.docx4j.convert.out.common.AbstractWmlExporter.process(AbstractWmlExporter.java:32)
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:71)
at org.docx4j.Docx4J.toFO(Docx4J.java:467)
at org.docx4j.Docx4J.toPDF(Docx4J.java:477)
at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.output(Conversion.java:70)
Thanks in advance, any help is very appreciated.