ron
ron

Reputation: 9396

Weblogic 10 shared library not showing up in referencing apps

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:

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:

Structure of shared lib ear in exploded directory format:

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!

Upvotes: 3

Views: 14970

Answers (2)

ron
ron

Reputation: 9396

Thanks for the information. Actually this is what I found out:

1) The listings of referencing applications disappear from the web console, if a referencing application fails at deployment (strange - maybe it has deeper reasons, but this is quite consistent now).

2) Unfortunately the classes inside a shared lib are loaded by the classloaders of the different referencing applications, so this way it is not possible to share for example interface classes for inter-application communication purposes.

Upvotes: 1

Pascal Thivent
Pascal Thivent

Reputation: 570595

I think that the MANIFEST.MF of the shared lib (which is an EAR) should contain a Class-Path entry referencing the JARs in lib (this tells the classloader where to look to find classes). Something like this:

Class-Path: lib/foo.jar lib/bar.jar lib/foobar.jar

Upvotes: 0

Related Questions