On WebLogic 10.0 I use the "Shared J2EE Libraries" ( http://download.oracle.com/docs/cd/E11035_01/wls100/programming/libraries.html ) feature of WLS to group some jars which would need to be accessible in multiple ear's. These jars resided on the system classpath, and I try to move them into the shared lib from there.
My problem is:
- in the WLS web admin console I click the shared library (named "theSharedLib") under Deployments
- the "Applications that reference this Library" list is empty
- I can also undeploy the lib using weblogic.Deployer, but on the next restart of the server it complains about the referenced library missing when loading the referencing application
So it seems that at startup the referencing takes effect, but in runtime WLS somehow forgets about this (do I need some magic trick here?).
I could also achieve this:
- undeploy theSharedLib (no complaining)
- undeploy someReferencingApp (ok)
- deploy someReferencingApp (error! missing lib)
- deploy theSharedLib (ok)
- deploy someReferencingApp (ok; app gets listed in the web console; however on next restart, or after random other deployments, the list gets empty again)
Structure of shared lib ear in exploded directory format:
- META-INF
- MANIFEST.MF
- application.xml
- lib
- (stuff I need to share as jars)
- dummyejb.jar (because it has to contain something)
MANIFEST.MF contains:
..
Extension-Name: theSharedLib
Specification-Version: 1.0
Implementation-Version: 1.0.0
..
application.xml contains basic elements (one dummyejb ejb module).
Structure of referencing app:
Among others, it has META-INF/weblogic-application.xml, containing:
<?xml version="1.0"?>
<weblogic-application>
<library-ref>
<library-name>theSharedLib</library-name>
<specification-version>1.0</specification-version>
<implementation-version>1.0.0</implementation-version>
<exact-match>true</exact-match>
</library-ref>
</weblogic-application>
What could be the problem? Should I do anything else in the shared lib or in the referencing apps to (1) have the references list correctly and most importantly (2) share the jars among the apps?
I presume the shared jars inside the lib are loaded using the same classloader in the shared lib for each application, behaving pretty much like the sys classpath behavior. Could you please also confirm this?
Thanks!