Page 1 of 1

Problems with Tomcat and docx4j

PostPosted: Wed Feb 26, 2014 11:54 pm
by geoM
Hi,

I would like to convert xhtml files in docx and it works just fine when I tested in a "Java Project" in Eclipse Juno.
If I wanted to do the same in a "Tomcat Project" with the same jar-libraries, then the application hangs and I have to restart Tomcat.
On the first line it hangs:
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage ();
and in log files of Tomcat can not find a reference (error).

I use: docx4j-3.0.1, JDK 7, Tomcat 7 on Windows 7

Please assist.

Re: Problems with Tomcat and docx4j

PostPosted: Thu Feb 27, 2014 6:19 am
by jason
I've never had any probs running docx4j in Tomcat.

I wonder whether it is just taking a long time to load the JAXB object model classes?

Or you could be running out of memory? Give Tomcat more memory with -Xmx etc.

Do you have docx4j logging (slf4j) set up?

geoM wrote:in log files of Tomcat can not find a reference (error).


I'm unclear here whether you are saying there is an error in the log files or not. If there is, please copy it here...

Re: Problems with Tomcat and docx4j

PostPosted: Tue Mar 04, 2014 8:03 pm
by julie
Hi, I think it's the same error as mine!
This error :
Code: Select all
javax.xml.bind.JAXBException: JAXB: neither Reference Implementation nor Java 6
implementation present?


Jonas is using tomcat.

I don't find how to resolve it, I try everything (I think) add jars in the Jonas lib directory or in my application but nothing works!

As someone an idea I am on this problem since 2 weeks... Please help me...

EDIT: My post : docx-java-f6/docx4j-and-jonas-t1803.html

Re: Problems with Tomcat and docx4j

PostPosted: Thu Mar 06, 2014 5:29 pm
by geoM
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.

Re: Problems with Tomcat and docx4j

PostPosted: Thu Mar 06, 2014 8:12 pm
by jason
Remove docx4j-MOXy-JAXBContext-3.0.0.jar from WEB-INF/lib, or if you keep it, add the EclipseLink MOXy jars.

Re: Problems with Tomcat and docx4j

PostPosted: Thu Mar 06, 2014 9:25 pm
by geoM
Thank you for your promptly reply.

I've tested both versions and get the same error message.

Re: Problems with Tomcat and docx4j

PostPosted: Thu Mar 06, 2014 9:51 pm
by jason
What do you mean "both versions"?

The error you are getting "ClassNotFoundException: org.eclipse.persistence.jaxb.JAXBContextFactory" is because you are telling it to use MOXy without providing the MOXy classes. You are telling it to use MOXy by including docx4j-MOXy-JAXBContext-3.0.0.jar.

For MOXy, you need the following in WEB-INF/lib:

org.eclipse.persistence.moxy-2.5.1.jar
org.eclipse.persistence.core-2.5.1.jar
org.eclipse.persistence.asm-2.5.1.jar
org.eclipse.persistence.antlr-2.5.1.jar

If you remove docx4j-MOXy-JAXBContext-3.0.0.jar, you might still get an error, but it will be different. Feel free to post it.

Re: Problems with Tomcat and docx4j

PostPosted: Thu Mar 06, 2014 11:20 pm
by geoM
I included docx4j-moxy-JAXBContext-3.0.0.jar and the 4 MOXy-libraries.

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-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/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
/TEST_docx4j_tom_source/WEB-INF/lib/docx4j-MOXy-JAXBContext-3.0.0.jar
/TEST_docx4j_tom_source/WEB-INF/lib/org.eclipse.persistence.antlr-2.5.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/org.eclipse.persistence.asm-2.5.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/org.eclipse.persistence.core-2.5.1.jar
/TEST_docx4j_tom_source/WEB-INF/lib/org.eclipse.persistence.moxy-2.5.1.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


The application hangs now and the log file looks like this:
Code: Select all
06.03.2014 13:27:16 *INFO * WordprocessingMLPackage: Using paper size: LETTER (WordprocessingMLPackage.java, line 375)
06.03.2014 13:27:16 *INFO * WordprocessingMLPackage: Landscape orientation: false (WordprocessingMLPackage.java, line 379)
06.03.2014 13:27:16 *INFO * Context: java.vendor=Oracle Corporation (Context.java, line 73)
06.03.2014 13:27:16 *INFO * Context: java.version=1.7.0_17 (Context.java, line 74)
06.03.2014 13:27:16 *INFO * Context:
jar:file:/D:/eclipse_workspace_juno/TEST_docx4j_tom_source/WEB-INF/lib/com.sun.tools.xjc_2.2.0.jar!/META-INF/MANIFEST.MF (Context.java, line 214)
06.03.2014 13:27:16 *INFO * Context: Implementation-Title : JAXB Reference Implementation  (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Version : 2.2 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Class-Path : jaxb-api.jar jaxb-impl.jar jsr173_1.0_api.jar activation.jar (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Vendor : Sun Microsystems, Inc. (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Created-By : 1.5.0_12-b04 (Sun Microsystems Inc.) (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Ant-Version : Apache Ant 1.7.0 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor : Sun Microsystems, Inc. (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Version : 2.2 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Main-Class : com.sun.tools.xjc.XJCFacade (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Extension-Name : com.sun.tools.xjc (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Build-Id : hudson-jaxb-ri-2.2-147 (Context.java, line 217)
06.03.2014 13:27:16 *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)
06.03.2014 13:27:16 *INFO * Context: Implementation-Title : JAXB Reference Implementation  (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Class-Path : jaxb-api.jar (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Extension-Name : com.sun.xml.bind.core (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
06.03.2014 13:27:16 *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)
06.03.2014 13:27:16 *INFO * Context: Implementation-Version : hudson-jaxb-ri-2.2-146 (Context.java, line 229)
06.03.2014 13:27:16 *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)
06.03.2014 13:27:16 *INFO * Context: Implementation-Title : JAXB Reference Implementation  (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Class-Path : jaxb-api.jar jaxb-core.jar (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Extension-Name : com.sun.xml.bind (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
06.03.2014 13:27:16 *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)
06.03.2014 13:27:16 *INFO * Context: Implementation-Title : JAXB Reference Implementation  (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Class-Path : jaxb-api.jar jaxb-core.jar jaxb-xjc.jar jaxb-impl.jar (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Main-Class : com.sun.tools.jxc.SchemaGeneratorFacade (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Extension-Name : com.sun.tools.jxc (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
06.03.2014 13:27:16 *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)
06.03.2014 13:27:16 *INFO * Context: Implementation-Title : JAXB Reference Implementation  (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Class-Path : jaxb-api.jar jaxb-core.jar (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Manifest-Version : 1.0 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Created-By : 1.6.0_41-b02 (Sun Microsystems Inc.) (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Ant-Version : Apache Ant 1.8.4 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor : Oracle Corporation (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Implementation-Vendor-Id : com.sun (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Title : Java Architecture for XML Binding (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Specification-Version : 2.2.7 (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Main-Class : com.sun.tools.xjc.XJCFacade (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Extension-Name : com.sun.tools.xjc (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: Build-Id : 04/24/2013 06:10 PM(yaroska) (Context.java, line 217)
06.03.2014 13:27:16 *INFO * Context: MOXy JAXB implementation intended.. (Context.java, line 95)
06.03.2014 13:27:21 *INFO * Context: MOXy JAXB implementation is in use! (Context.java, line 142)

Re: Problems with Tomcat and docx4j

PostPosted: Fri Mar 07, 2014 1:48 am
by geoM
Thanks again Jason!

It works now! Tomcat was running on "out of memory", as you suggested.

Current settings:
Code: Select all
Initial memory pool: 4096
Maximum memory pool: 4096
Thread stack size: 2048

and under Java Options:

-XX: MaxPermSize = 4096m // that I had unfortunately forgotten :-(

Now it works fine, thank you!

Re: Problems with Tomcat and docx4j

PostPosted: Fri Mar 07, 2014 7:05 am
by jason
Great. Also, you ought to be able to remove:

Code: Select all
/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


Normally if you wanted to use the reference implementation, you'd need to use the Java endorsed dir mechanism (or consult your app server documentation regarding classloaders etc).

Re: Problems with Tomcat and docx4j

PostPosted: Fri Mar 07, 2014 6:12 pm
by geoM
Without jaxb-impl-2.2_1.jar I'm getting an error in NamespacePrefixMapper, namely "com.sun.xml.bind can not be resolved to a type", so I've only referenced this library.

Thank you for this hint!

Re: Problems with Tomcat and docx4j

PostPosted: Thu Mar 13, 2014 1:34 pm
by jason
You should be able to ignore that warning and remove the jar.