Page 1 of 1

Websphere & docx4j

PostPosted: Fri Aug 22, 2014 11:03 am
by scott.hargreaves
I've been attempting to run docx4j as a component of an IBM FileNet workflow (runs as a WebSphere Application) and I'm receiving the following error:

Code: Select all
javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 61 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "CT_TwipsMeasure". Use @XmlType.name and @XmlType.namespace to assign different names to them.
   this problem is related to the following location:
      at org.docx4j.wml.CTTwipsMeasure
      at protected org.docx4j.wml.CTTwipsMeasure org.docx4j.wml.CTFramesetSplitbar.w
      at org.docx4j.wml.CTFramesetSplitbar
      at public org.docx4j.wml.CTFramesetSplitbar org.docx4j.wml.ObjectFactory.createCTFramesetSplitbar()
      at org.docx4j.wml.ObjectFactory
... (61 repeating class names)


The Java version is IBM J9 VM (build 2.6) on Windows Server 2008 R2 Enterprise. There is a JAXB implementation on the classpath that "may" screwing things up but for I can't duplicate this error outside of WebSphere with the same JRE and JAXB versions. The following is the DOCX4J output:

Code: Select all
[8/21/14 16:48:11:620 PDT] 000000ca Context       I org.docx4j.jaxb.Context <clinit> java.vendor=IBM Corporation
[8/21/14 16:48:11:620 PDT] 000000ca Context       I org.docx4j.jaxb.Context <clinit> java.version=1.6.0
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo
wsjar:file:/C:/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/DEVP852CPENode01Cell/FileNetEngine.ear/acce_navigator.war/WEB-INF/lib/jaxb-impl.jar!/META-INF/MANIFEST.MF
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Implementation-Vendor : Sun Microsystems, Inc.
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Implementation-Vendor-Id : com.sun
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Specification-Title : Java Architecture for XML Binding
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Specification-Version : 2.1
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Ant-Version : Apache Ant 1.6.5
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Specification-Vendor : Sun Microsystems, Inc.
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Extension-Name : com.sun.xml.bind
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Manifest-Version : 1.0
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Build-Id : 10/17/2011 05:21 AM(foreman)
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Class-Path : jaxb-api.jar activation.jar jsr173_1.0_api.jar jaxb1-impl.jar
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Created-By : 2.3 (IBM Corporation)
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Implementation-Title : JAXB Reference Implementation
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Implementation-Version : 2.1.10
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Found JAXB reference implementation in wsjar:file:/C:/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/DEVP852CPENode01Cell/FileNetEngine.ear/acce_navigator.war/WEB-INF/lib/jaxb-impl.jar!/META-INF/MANIFEST.MF
[8/21/14 16:48:11:698 PDT] 000000ca Context       I org.docx4j.jaxb.Context searchManifestsForJAXBImplementationInfo Implementation-Version : 2.1.10-10/17/2011 05:21 AM(foreman)-fcs
[8/21/14 16:48:11:792 PDT] 000000ca Context       I org.docx4j.jaxb.Context <clinit> No MOXy JAXB config found; assume not intended..
[8/21/14 16:48:11:886 PDT] 000000ca NamespacePref I org.docx4j.jaxb.NamespacePrefixMapperUtils getPrefixMapper Using NamespacePrefixMapperSunInternal, which is suitable for Java 6
[8/21/14 16:48:11:886 PDT] 000000ca Context       I org.docx4j.jaxb.Context <clinit> Using Java 6/7 JAXB implementation
[8/21/14 16:48:13:636 PDT] 000000ca Context       E org.docx4j.jaxb.Context <clinit> Cannot initialize context


This looks very similar to this post: websphere-and-domino-f26/websphere-and-docx4j-t1725.html
but I have tried the suggestions there without any success.

Any thoughts on this one?

Re: Websphere & docx4j

PostPosted: Tue Aug 26, 2014 10:42 pm
by jason
Did you try MOXy? (3rd post from the bottom in that thread)