Search This Blog

Thursday, 11 November 2010

Referencing Coherence from Web Applications (WAR) in WLS 11g

I am constantly providing coherence.jar in the WEB-INF/lib of my web based (WAR) applications in WLS 11g. So obviously it made more sense to deploy coherence.jar as library and then reference it but WLS 11g does not allow web based applications to reference shared library JAR files as per the link below.

http://download.oracle.com/docs/cd/E13222_01/wls/docs92/programming/libraries.html#wp1071062

"You cannot reference any other type of shared J2EE library (EJB, Enterprise application, or plain JAR file) from the weblogic.xml deployment descriptor file of a Web Application."

Here is what i did to get this to work.

1. Create a shared library coherence.jar for version 3.6 as shown below. I targeted this to the managed servers I was using.



2. In my WAR file create a META-INF/MANIFEST.MF with content as follows.

Extension-List: cohlib
cohlib-Extension-Name: coherence
cohlib-Specification-Version: 3.6.0.0
cohlib-Implementation-Version: 3.6.0.0

3. The JDeveloper 11g project would look something like this, as you can clearly see there is no coherence.jar in WEB-INF\lib folder with this setup.


I found this setup as follows enabling me to use JAR files as libraries from WAR / Web Based Applications.

http://download.oracle.com/docs/cd/E13222_01/wls/docs92/programming/libraries.html#wp1064645

No comments: