When I run the following code, I got exceptioninitializererror.
String inputfilepath = "Stamp_Template.docx";
WordprocessingMLPackage wordMLPackage= null;
File templatef = new File(inputfilepath);
try {
wordMLPackage = WordprocessingMLPackage.load(templatef);
} catch (Docx4JException e) {
System.err.println("Caught DocException: " + e.getMessage());
}
java.lang.ExceptionInInitializerError
at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.<clinit>(Conversion.java:103)
at org.docx4j.utils.Log4jConfigurator.configure(Log4jConfigurator.java:48)
at org.docx4j.jaxb.Context.<clinit>(Context.java:51)
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:666)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:206)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:193)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:301)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:245)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:195)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:178)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:172)
at com.motorolasolutions.osrb.servlet.StampGeneration.doGet(StampGeneration.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:42)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.atlassian.jira.web.filters.XContentTypeOptionsNoSniffFilter.doFilter(XContentTypeOptionsNoSniffFilter.java:22)
at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
.........(more)
I use 2.8.1 docx4j.
Any comment.
If I run:
public static JAXBContext context = org.docx4j.jaxb.Context.jc;
I can not even start servlet. I got the similar
ExceptionInInitializerError.