DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Updating EclipseLink in WebLogic

Blaise Doughan user avatar by
Blaise Doughan
·
Oct. 31, 12 · Interview
Like (0)
Save
Tweet
Share
8.70K Views

Join the DZone community and get the full member experience.

Join For Free
JSON binding was added to EclipseLink in version 2.4.  If you are using a version of that does not contain this version (i.e. WebLogic 10.3.4 (11g) contains EclipseLink 2.1.2), then by default you won't have access to this functionality. The recommended solution to this problem is to create a shared library in WebLogic for the newer release of EclipseLink.


Create the Shared Library

WebLogic has the concept of shared libraries. These are deployed as an EAR. Below is what the EAR will look like for creating a shared library for EclipseLink 2.4.

EclipseLink24_SharedLibrary.ear 
  • lib/eclipselink.jar 
  • META-INF/application.xml 
  • META-INF/MANIFEST.MF 
  • META-INF/weblogic-application.xml
application.xml
<application>
  <display-name>EclipseLink 2.4 Shared Library</display-name>
  <module>
    <java></java>
  </module>
</application>
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.4.0
Specification-Version: 2.4.0
Implementation-Version: 2.4.0.v20120608-r11652
weblogic-application.xml
<weblogic-application>
  <prefer-application-packages>
    <package-name>org.eclipse.persistence.*</package-name>
  </prefer-application-packages>
</weblogic-application>
Use the Shared Library

Once the shared library has been deployed, you need to configure your enterprise applications to use it.

SampleApplication.ear
  • META-INF/MANIFEST.MF 
  • META-INF/weblogic-application.xml 
  • SampleApplication.war 

weblogic-application.xml 

The weblogic-application.xml file is used to reference the shared library. The entries in the library-ref element need to match the corresponding entries from MANIFEST.MF in the shared library.
<?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.4.0</wls:library-name>
        <wls:specification-version>2.4.0</wls:specification-version>
        <wls:implementation-version>2.4.0.v20120608-r11652</wls:implementation-version>
        <wls:exact-match>true</wls:exact-match>
    </wls:library-ref>
</wls:weblogic-application>
TestServlet

Below is a test servlet that you could include in the WAR to test the EclipseLink version.
package com.example;
 
import java.io.IOException;
import java.io.PrintWriter;
 
import javax.servlet.ServletException;
import javax.servlet.http.*;
 
public class TestServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
 
    public TestServlet() {
        super();
    }
 
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.append("<html><body>");
        out.append(org.eclipse.persistence.Version.getVersion());
        out.append("</body></html>");
    }
 
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    }
 
}
For More Information
  • http://buttso.blogspot.com/2011/07/plugging-in-later-version-of.html
 
 
 
 
 
 
EclipseLink

Published at DZone with permission of Blaise Doughan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Should You Know About Graph Database’s Scalability?
  • Kotlin Is More Fun Than Java And This Is a Big Deal
  • Iptables Basic Commands for Novice
  • How Do the Docker Client and Docker Servers Work?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: