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

梦想与她 提交于 2019-12-04 06:03:42

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

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>

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!