Thanks for your reply Jason.
I have now installed docx4j-3.0.1-sources in the application and logging on.
Currently I get the following error:
javax.xml.bind.JAXBException: Provider org.eclipse.persistence.jaxb.JAXBContextFactory not found
- With linked exception:
[java.lang.ClassNotFoundException: org.eclipse.persistence.jaxb.JAXBContextFactory]
- Code: Select all
05.03.2014 14:55:15 *INFO * WordprocessingMLPackage: Using paper size: LETTER (WordprocessingMLPackage.java, line 375)
05.03.2014 14:55:15 *INFO * WordprocessingMLPackage: Landscape orientation: false (WordprocessingMLPackage.java, line 379)
05.03.2014 14:55:15 *INFO * Context: java.vendor=Oracle Corporation (Context.java, line 73)
05.03.2014 14:55:15 *INFO * Context: java.version=1.7.0_17 (Context.java, line 74)
05.03.2014 14:55:15 *INFO * Context:
jar:file:/D:/eclipse_workspace_juno/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-core.jar!/META-INF/MANIFEST.MF (Context.java, line 214)
05.03.2014 14:55:15 *INFO * Context: Implementation-Title : JAXB Reference Implementation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Class-Path : jaxb-api.jar (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Extension-Name : com.sun.xml.bind.core (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Found JAXB reference implementation in jar:file:/D:/eclipse_workspace_juno/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-impl-2.2_1.jar!/META-INF/MANIFEST.MF (Context.java, line 225)
05.03.2014 14:55:15 *INFO * Context: Implementation-Version : hudson-jaxb-ri-2.2-146 (Context.java, line 229)
05.03.2014 14:55:15 *INFO * Context:
jar:file:/D:/eclipse_workspace_juno/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-impl.jar!/META-INF/MANIFEST.MF (Context.java, line 214)
05.03.2014 14:55:15 *INFO * Context: Implementation-Title : JAXB Reference Implementation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Class-Path : jaxb-api.jar jaxb-core.jar (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Extension-Name : com.sun.xml.bind (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context:
jar:file:/D:/eclipse_workspace_juno/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-jxc.jar!/META-INF/MANIFEST.MF (Context.java, line 214)
05.03.2014 14:55:15 *INFO * Context: Implementation-Title : JAXB Reference Implementation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Class-Path : jaxb-api.jar jaxb-core.jar jaxb-xjc.jar jaxb-impl.jar (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Main-Class : com.sun.tools.jxc.SchemaGeneratorFacade (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Extension-Name : com.sun.tools.jxc (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context:
jar:file:/D:/eclipse_workspace_juno/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-xjc.jar!/META-INF/MANIFEST.MF (Context.java, line 214)
05.03.2014 14:55:15 *INFO * Context: Implementation-Title : JAXB Reference Implementation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Class-Path : jaxb-api.jar jaxb-core.jar (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Main-Class : com.sun.tools.xjc.XJCFacade (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Extension-Name : com.sun.tools.xjc (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
05.03.2014 14:55:15 *INFO * Context: MOXy JAXB implementation intended.. (Context.java, line 95)
05.03.2014 14:55:15 *ERROR* Context: Cannot initialize context (Context.java, line 166)
[b]javax.xml.bind.JAXBException: Provider org.eclipse.persistence.jaxb.JAXBContextFactory not found
- with linked exception:
[java.lang.ClassNotFoundException: org.eclipse.persistence.jaxb.JAXBContextFactory][/b]
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at org.docx4j.jaxb.Context.<clinit>(Context.java:131)
at org.docx4j.openpackaging.parts.JaxbXmlPart.<init>(JaxbXmlPart.java:86)
at org.docx4j.openpackaging.parts.JaxbXmlPartXPathAware.<init>(JaxbXmlPartXPathAware.java:56)
at org.docx4j.openpackaging.parts.JaxbXmlPartAltChunkHost.<init>(JaxbXmlPartAltChunkHost.java:72)
at org.docx4j.openpackaging.parts.WordprocessingML.DocumentPart.<init>(DocumentPart.java:158)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.<init>(MainDocumentPart.java:94)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.createPackage(WordprocessingMLPackage.java:393)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.createPackage(WordprocessingMLPackage.java:381)
at bsp.docxServlet.doGet(docxServlet.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.jaxb.JAXBContextFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at javax.xml.bind.ContextFinder.safeLoadClass(Unknown Source)
... 31 more
05.03.2014 14:55:15 *INFO * PageDimensions: Using paper size: LETTER (PageDimensions.java, line 209)
05.03.2014 14:55:15 *INFO * PageDimensions: Landscape orientation: false (PageDimensions.java, line 213)
05.03.2014 14:55:15 *INFO * RelationshipsPart: adding part with proposed name: /word/document.xml (RelationshipsPart.java, line 430)
05.03.2014 14:55:15 *INFO * Base: shortcut was set (Base.java, line 291)
05.03.2014 14:55:15 *INFO * JaxbXmlPartXPathAware: For org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart, unmarshall via binder (JaxbXmlPartXPathAware.java, line 300)
05.03.2014 14:55:15 *INFO * RelationshipsPart: adding part with proposed name: /word/styles.xml (RelationshipsPart.java, line 430)
05.03.2014 14:55:15 *INFO * Base: shortcut was set (Base.java, line 291)
05.03.2014 14:55:15 *INFO * XPathFactoryUtil: xpath implementation: org.apache.xpath.jaxp.XPathFactoryImpl (XPathFactoryUtil.java, line 22)
05.03.2014 14:55:15 *INFO * RelationshipsPart: adding part with proposed name: /docProps/core.xml (RelationshipsPart.java, line 430)
05.03.2014 14:55:15 *INFO * Base: shortcut was set (Base.java, line 291)
05.03.2014 14:55:15 *INFO * RelationshipsPart: adding part with proposed name: /docProps/app.xml (RelationshipsPart.java, line 430)
05.03.2014 14:55:15 *INFO * Base: shortcut was set (Base.java, line 291)
05.03.2014 14:55:15 *INFO * RelationshipsPart: adding part with proposed name: /word/numbering.xml (RelationshipsPart.java, line 430)
05.03.2014 14:55:15 *INFO * Base: shortcut was set (Base.java, line 291)
Referenced Libraries:
- Code: Select all
/TEST_docx4j_tom_source/WEB-INF/lib/antlr-2.7.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/antlr-runtime-3.3.jar
/TEST_docx4j_tom_source/WEB-INF/lib/avalon-framework-api-4.3.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/avalon-framework-impl-4.3.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-anim-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-awt-util-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-bridge-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-css-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-dom-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-ext-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-extension-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-gvt-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-js-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-parser-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-script-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-svg-dom-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-svggen-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-transcoder-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-util-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/batik-xml-1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/commons-codec-1.3.jar
/TEST_docx4j_tom_source/WEB-INF/lib/commons-io-1.3.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/commons-lang-2.4.jar
/TEST_docx4j_tom_source/WEB-INF/lib/commons-logging-1.1.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/docx4j-3.0.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/docx4j-ImportXHTML-3.0.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/fop-1.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/iText-2.1.7.jar
/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-svg11-1.0.2.jar
/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-xmldsig-core-1.0.0.jar
/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-xslfo-1.0.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/log4j-1.2.17.jar
/TEST_docx4j_tom_source/WEB-INF/lib/poi-3.8.jar
/TEST_docx4j_tom_source/WEB-INF/lib/poi-scratchpad-3.8.jar
/TEST_docx4j_tom_source/WEB-INF/lib/serializer-2.7.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/slf4j-api-1.7.5.jar
/TEST_docx4j_tom_source/WEB-INF/lib/slf4j-log4j12-1.7.5.jar
/TEST_docx4j_tom_source/WEB-INF/lib/stringtemplate-3.2.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/wmf2svg-0.9.0.jar
/TEST_docx4j_tom_source/WEB-INF/lib/xalan-2.7.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/xhtmlrenderer-3.0.0.jar
/TEST_docx4j_tom_source/WEB-INF/lib/xmlgraphics-commons-1.5.jar
/TEST_docx4j_tom_source/WEB-INF/lib/docx4j-MOXy-JAXBContext-3.0.0.jar
/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-api.jar
/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-impl-2.2_1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/jaxb-core.jar
/TEST_docx4j_tom_source/WEB-INF/lib/xercesImpl-2.9.0.jar
TOMCAT_HOME\lib\servlet-api.jar
TOMCAT_HOME\lib\jasper.jar
TOMCAT_HOME\lib\jsp-api.jar
TOMCAT_HOME\lib\el-api.jar
TOMCAT_HOME\lib\annotations-api.jar
C:\Downloads\docx4j\eclipselink-2.5.1.v20130918-f2b9fc5\eclipselink\jlib\eclipselink.jar [i](inserted for org.eclipse.persistence.jaxb.JAXBContextFactory)[/i]
The doGet method of servlet contains only the following lines:
- Code: Select all
wordMLPackage = WordprocessingMLPackage.createPackage();
XHTMLImporterImpl xHTMLImporter = new XHTMLImporterImpl(wordMLPackage);
xHTMLImporter.setHyperlinkStyle("Hyperlink");
wordMLPackage.getMainDocumentPart().getContent().addAll(xHTMLImporter.convert(new File(inputfilepath), null) );
wordMLPackage.save(new java.io.File("tdk_xhtml.docx"));
With the same code as standalone application works perfectly, as has been written here before.
I use: docx4j-3.0.1, JDK7, Tomcat 7.0.37 under Windows 7 64-bit (Eclipse Juno)
Thank you for any help you can provide.