EAR and WebContextClassLoader

N

Nirav

Hi,

I'm working on an application consisting of two components, one EJB and
one Web.
Both components share some dependecies like hibernate, spring, xwork
etc. Since EJBs are deployed first, the MANIFEST file there has entries
for classpath for loading these dependencies to ensure classloader for
Web will resolve it ( i'm assuming that ejb classloader will be parent
of web classloaders, the jboss case ), application has one lib
directory in EAR root which contains all the libraries ( i can't move
it to web-inf/lib ).

Now, for reasons, i've to move EJB component to EAR/lib directory,
works fine for EJB but Web component is not getting deployed with
bewildering, as expected, ClassNotFoundException. The problem will not
be resolved even if i write same classpath entries in Web components
MANIFEST, since the parent classloader will not be able to resolve it,
had it been loaded by child web classloader.

My question is, is there any way i can load those dependency before Web
Component is deployed? i've tried adding classpath entries in
EAR/meta-inf/MANIFEST but didn't worked.

Nirav Thaker
 
I

iksrazal

Nirav escreveu:
Hi,

I'm working on an application consisting of two components, one EJB and
one Web.
Both components share some dependecies like hibernate, spring, xwork
etc. Since EJBs are deployed first, the MANIFEST file there has entries
for classpath for loading these dependencies to ensure classloader for
Web will resolve it ( i'm assuming that ejb classloader will be parent
of web classloaders, the jboss case ), application has one lib
directory in EAR root which contains all the libraries ( i can't move
it to web-inf/lib ).

Now, for reasons, i've to move EJB component to EAR/lib directory,
works fine for EJB but Web component is not getting deployed with
bewildering, as expected, ClassNotFoundException. The problem will not
be resolved even if i write same classpath entries in Web components
MANIFEST, since the parent classloader will not be able to resolve it,
had it been loaded by child web classloader.

My question is, is there any way i can load those dependency before Web
Component is deployed? i've tried adding classpath entries in
EAR/meta-inf/MANIFEST but didn't worked.

Nirav Thaker

The manifest entries have to be _exactly_ right. I suggest using the
supplied tool of the app server to do this. Just in case it isn't
clear, each WAR/meta-inf/MANIFEST needs to be edited suppling the path.
In VI it would be:

Manifest-Version: 1.0
Main-Class: null
Class-Path: lib/protomatter-1.1.8-pre5.jar lib/fazenda.jar
<blank line>

HTH,
iksrazal
http://www.braziloutsource.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top