Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 911
Sascha Handke Avatar asked Jul 02 '13 09:07

Sascha Handke


3 Answers

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

  • http://blog.bdoughan.com/2012/10/updating-eclipselink-in-weblogic.html
like image 197
bdoughan Avatar answered Oct 24 '22 10:10

bdoughan


The solution provided by Blaise in his Blogpost does not work with WebLogic 12c. The solution to get it working is a minor change to the application.xml by explicitly defining the used library:

<application>
  <display-name>EclipseLink 2.5 Shared Library</display-name>
    <module>
      <java>lib/eclipselink.jar</java>
  </module>
</application>
like image 42
Sascha Handke Avatar answered Oct 24 '22 09:10

Sascha Handke


I prefered to switch back to the JAXB RI instead of using the buggy moxy JAXB. Here is how you can do it: http://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#CIHBHDGI

I used the Methode where the following jar module file is put in the "startWebLogic.cmd": set PRE_CLASSPATH=$wls_home/modules/databinding.override_1.0.0.0.jar

to have it first in the classpath.

like image 43
peter Avatar answered Oct 24 '22 10:10

peter