Page 1 of 1

WebLogic and JAXB

PostPosted: Thu Jul 04, 2013 8:42 am
by jason
This post brings together some web wisdom on getting docx4j working in WebLogic, where old JAXB implementations cause problems.

Rather than comment on this thread, please use a discussion with subject:

"WebLogic x.y.z with EclipseLink MOXy"

OR

"WebLogic x.y.z with Glassfish RI JAXB"

as appropriate.

Background

For Oracle WebLogic Server 12c Release 1 (12.1.1), http://docs.oracle.com/cd/E24329_01/web ... _types.htm says:

WebLogic Server provides two data binding and JAXB providers:

EclipseLink MOXy, the default in this release of WebLogic Server, is a fully compliant JAXB implementation.
:
No configuration is required to use the EclipseLink MOXy providers.

Glassfish RI JAXB, which is the default Glassfish JAXB implementation, and was the default JAXB offering in WebLogic Server in previous releases. The Glassfish RI JAXB proprietary features will not work with EclipseLink MOXy. If desired, you can enable the Glassfish RI JAXB data binding and JAXB providers at the server or application level. For more information, see "Using the Glassfish RI JAXB Data Binding and JAXB Providers".


Generally, to use MOXy with docx4j, you need http://www.docx4java.org/docx4j/docx4j- ... -3.0.0.jar
to say use EclipseLink with docx4j.

WebLogic Server 12c Release 1 (12.1.1)

Maybe you don't need docx4j-MOXy-JAXBContext-3.0.0.jar, since MOXy is the default for this version of WebLogic. But it can't hurt, and it will ensure docx4j's log messages make sense.

But in any case you definitely need to update EclipseLink to 2.5.1. One way to do this:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  <dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>org.eclipse.persistence.moxy</artifactId>
    <version>2.5.1</version>
  </dependency>


  <prefer-application-packages>
    <package-name>antlr.*</package-name>
    <package-name>org.eclipse.persistence.*</package-name>
  </prefer-application-packages>  
 
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


For another way, see
http://stackoverflow.com/questions/1742 ... server-12c

Swapping to Glassfish RI JAXB provider

If you want to use Glassfish RI JAXB provider instead of MOXy, see http://docs.oracle.com/cd/E24329_01/web ... m#CIHBHDGI for how to change the "JAXB provider"

Earlier releases of WebLogic

These used Glassfish RI JAXB.

If you want to swap to MOXy, see again http://stackoverflow.com/questions/1742 ... server-12c