SyntaxHighlighter JS

2015-09-20

Migrating JAXB from WebLogic 11g to WebLogic 12c

From WebLogic 11g to WebLogic 12c, the default JAXB implementation changed from Glassfish RI to EclipseLink MOXy. (1)

EclipseLink MOXy has some fun surprises and bugs if you are not expecting it. The JAXB bindings and data population may not work as previously expected. Click the links below for some examples.


To revert to the previous version of Glassfish RI in WebLogic 12, try one of the solutions below.

Use Glassfish RI at the application level
1. Add the following section to the weblogic-application.xml of the EAR archive

<prefer-application-resources>
    <resource-name>
      META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory
    </resource-name>

    <resource-name>
      META-INF/services/javax.xml.bind.JAXBContext

    </resource-name>
</prefer-application-resources>

2. In the EAR archive, create the file
META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory

In this file, just add this one line

com.sun.xml.ws.db.glassfish.JAXBRIContextFactory

3. In the EAR archive, create the file
META-INF/services/javax.xml.bind.JAXBContext

In this file, just add this one line

com.sun.xml.bind.v2.ContextFactory

Use Glassfish RI at the Weblogic Server level
In the file user_projects/domain/mydomain/bin/setDomainEnv.sh, change the following

from
WL_HOME="/mypath/Oracle/Middleware/Oracle_Home/wlserver"
export WL_HOME

to
WL_HOME="/mypath/Oracle/Middleware/Oracle_Home/wlserver"
export WL_HOME

PRE_CLASSPATH="${WL_HOME}/modules/databinding.override_1.2.0.0.jar
export PRE_CLASSPATH

Use Glassfish RI with WebLogic client tools like jwsc
Add the Java system properties to the jwsc tool classpath

-Dcom.sun.xml.ws.spi.db.BindingContextFactory=
com.sun.xml.ws.db.glassfish.JAXBRIContextFactory,
javax.xml.bind.JAXBContext=
com.sun.xml.bind.v2.ContextFactory


Source
(1) http://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#WSGET345

No comments:

Post a Comment