Java Version information
1) 32-bit
2) version - 1.8.0_242
3) Amazon.com Inc.
Please find the below code:
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(tmpSourceFile.toFile());
pageCount=wordMLPackage.getDocPropsExtendedPart().getContents().getPages();
log.info("pageCount : " +pageCount);
Currently we are using docx4j-6.1.0.jar file and we try to update with docx4j-8.3.0 version.
We didn't see the exact jar file like in version 6.1.0 even though we tried with jars present in docx4j-community-8.3.0.
Do you know which jar files we need to update other than the jar file present in docx4j-community-8.3.0?
We are getting the error message that JAXB can’t be instantiate and as subsequent error:
org.docx4j.openpackaging.exceptions.Docx4JException: Couldn't get [Content_Types].xml from ZipFile
at org.docx4j.openpackaging.io3.Load3.get(Load3.java:148)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:561)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:410)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:287)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:265)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:168)
at com.bayer.bbs.wcsservices.attanalyzer.AttAnalyzerWorkerProcess.service(AttAnalyzerWorkerProcess.java:179)
at com.bayer.bbs.service.process.AbstractProcess$1.run(AbstractProcess.java:10)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.docx4j.openpackaging.exceptions.InvalidFormatException: Bad [Content_Types].xml
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:871)
at org.docx4j.openpackaging.io3.Load3.get(Load3.java:146)
... 8 more
Caused by: java.lang.RuntimeException: javax.xml.bind.JAXBException: JAXB: Can't instantiate JAXB Reference Implementation
- with linked exception:
[java.lang.ClassNotFoundException: org.docx4j.jaxb.ri.NamespacePrefixMapper]
at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:901)
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:851)
... 9 more
Caused by: javax.xml.bind.JAXBException: JAXB: Can't instantiate JAXB Reference Implementation
- with linked exception:
[java.lang.ClassNotFoundException: org.docx4j.jaxb.ri.NamespacePrefixMapper]
at org.docx4j.jaxb.NamespacePrefixMapperUtils.tryUsingRI(NamespacePrefixMapperUtils.java:95)
at org.docx4j.jaxb.NamespacePrefixMapperUtils.getPrefixMapper(NamespacePrefixMapperUtils.java:71)
at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:850)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.docx4j.jaxb.ri.NamespacePrefixMapper
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.docx4j.jaxb.NamespacePrefixMapperUtils.tryUsingRI(NamespacePrefixMapperUtils.java:79)
... 12 more