Discussion:
Weblogic, Loading order of jars in APP-INF/lib/
(too old to reply)
a***@yahoo.com
2006-09-30 01:10:12 UTC
Permalink
Hi,
I would like to know the order in which the jar files are loaded from
<deployment>/APP-INF/lib, in weblogic 8.1. This really matters when we
have the same class in two or more jar files, in APP-INF/lib. For an
example, if I have test.class inside a.jar and b.jar (jar files are
inside APP-INF/lib), when classloader loads the test.class, which will
be loaded, from a.jar or from b.jar?
Thanks in advance,
Amila
s***@gmail.com
2006-10-16 20:04:40 UTC
Permalink
Post by a***@yahoo.com
Hi,
I would like to know the order in which the jar files are loaded from
<deployment>/APP-INF/lib, in weblogic 8.1. This really matters when we
have the same class in two or more jar files, in APP-INF/lib. For an
example, if I have test.class inside a.jar and b.jar (jar files are
inside APP-INF/lib), when classloader loads the test.class, which will
be loaded, from a.jar or from b.jar?
Thanks in advance,
Amila
Dear sir,

According to specifications, I don't think you can be guaranteed any
load-order of .jar files in this way.

Anyway, if classes are really the same, the jar load order shouldn't
matter... And I wouldn't recommend under any circumstances to use
different classes - with same package and classnames... Most likely,
you'll end up with with a marshalling error down the road (when
different classloaders on fx. client/server loads from a.jar and b.jar
- and try to process objects passed from each other).

As you're probably aware of - just remember to make sure that classes
using each other through static initializers are all contained in the
same .jar . That's easier than trying to make sure that .jar's are
loaded in any particular order.

Hope to have been of service! Best of luck.

/www.seniorconsultant.co.uk

Loading...