How to replace EclipseLink 2.3.2 with EclipseLink 2.5 in WebLogic Server 12c

docx4jeclipselinkmoxyweblogic12c

I currrently try to run Docx4j in WebLogic Server 12c. WebLogic Server 12c comes with EclipseLink 2.3.2.

There is a similar Post describing the situation which unfortunately yield no answer.

Docx4j does not work with the JAXB (MOXy) implementation which is part of EclipseLink 2.3.2. I got Docx4j running standalone with EclipseLink 2.5. So I am very confident that using EclipseLink 2.5 with Weblogic Server 12c will solve the issue with Docx4j.

How can I replace the EclipseLink Vesion 2.3.2 the WebLogic Server 12c is running on with EclipseLink Version 2.5?

Best Answer

You can created a shared library in WebLogic to update the version of EclipseLink.

CREATE THE SHARED LIBRARY

EclipseLink25_SharedLibrary.ear

The shared library is an EAR with the following contents

  • lib/eclipselink.jar
  • META-INF/application.xml

    <application>
      <display-name>EclipseLink 2.5 Shared Library</display-name>
      <module>
          <java></java>
      </module>
    </application>
    
  • META-INF/MANIFEST.MF

    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.8.2
    Created-By: 1.7.0_04-b21 (Oracle Corporation)
    Extension-Name: EclipseLink-2.5.0
    Specification-Version: 2.5.0
    Implementation-Version: 2.5.0.v20130507
    
  • META-INF/weblogic-application.xml

    <weblogic-application>
       <prefer-application-packages>
           <package-name>org.eclipse.persistence.*</package-name>
      </prefer-application-packages>
    
    </weblogic-application>
    

USE THE SHARED LIBRARY

Belowis how you would package your application to use the shared library,

SampleApplication.ear

  • META-INF/MANIFEST.MF
  • META-INF/weblogic-application.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-application xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.2/weblogic-application.xsd">
        <!--weblogic-version:10.3.4-->
        <wls:application-param>
            <wls:param-name>webapp.encoding.default</wls:param-name>
            <wls:param-value>UTF-8</wls:param-value>
        </wls:application-param>
        <wls:library-ref>
            <wls:library-name>EclipseLink-2.5.0</wls:library-name>
            <wls:specification-version>2.5.0</wls:specification-version>
            <wls:implementation-version>2.5.0.v20130507</wls:implementation-version>
           <wls:exact-match>true</wls:exact-match>
        </wls:library-ref>
    </wls:weblogic-application>
    
  • SampleApplication.war


FOR MORE INFORMATION

Related Topic