It looks like the class loading is not working for me as described at
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/ccli_classloading.html.
Here is what is happening:
I have an EAR, in which a client jar (clientlauncher.jar) resides. The
Class-Path in its Manifest.mf is as follows:
Class-Path: plugins/framework plugins/checkservices
plugins/transferservices plugins/alerts plugins/pr
plugins/pr/achapps plugins/pr/wireapps
pr-hotfix.jar pr.jar
The main class of the clientlauncher.jar, Launcher, should load
another class. But it looks like it always does that from pr.jar,
even when I put a modified version of the second class
under, say, EAR_ROOT/plugins/pr (which is first on the classpath).
Here's an experiment. I created the Launcher class as follows:
public static void main(String[]argv) {
String mainClass = argv[0];
ClassLoader loader = Launcher.class.getClassLoader();
String resource = mainClass.replaceAll("\\.", "/") + ".class";
System.out.println(mainClass +
": " +
loader.getResource(resource));
URL url = null;
int i = 1;
for (Enumeration en = loader.getResources(resource);
en.hasMoreElements();) {
url = (URL) en.nextElement();
System.out.println(i + ". " + mainClass + ": " + url);
i++;
}
And here is what I get, when com.ph.pr.common.install.Noop class is
both in pr.jar and in plugins/pr, under the EAR:
com.ph.pr.common.install.Noop:
jar:file:/D:/apps/wcmsuite73/installedApps/WCM73_PaymentsAndReporting.ear/pr.jar!/com/ph/pr/common/install/Noop.class
1. com.ph.pr.common.install.Noop:
jar:file:/D:/apps/wcmsuite73/installedApps/WCM73_PaymentsAndReporting.ear/pr.jar!/com/ph/pr/common/install/Noop.class
2. com.ph.pr.common.install.Noop:
file:/D:/apps/wcmsuite73/installedApps/WCM73_PaymentsAndReporting.ear/plugins/pr/com/ph/pr/common/install/Noop.class
In other words, as you can see, the JAR one gets loaded first!
(But it certainly does find the one under plugins/pr if I do
getResources()).
That is to say, it seems that the order of Class-Path: entries
in Manifest.mf is not honored...
Thanks.
"DEBEDb" <deb...@gmail.com> wrote in message
news:1149697614.5...@j55g2000cwa.googlegroups.com...