It really depends on how the classes are related. In my case I had
classes in my ejb-jar that were subclasses of third party classes in my
webapp. The WebApp classloader knows about classes loaded by the ejb
classloader but not the other way around. So when my jsps tried to the
load the subclasses it picked up the ones loaded by the ejb classloader
who in turn couldn't find the parent classes because they were specified
to the webapp classloader. Confusing huh.

I would advise you take a go look at the classes you have and how they
relate. Then figure what needs to go into the ejb-jar and what needs to
go into the webapp jar. In my case it was inheritance of third party
classes that bit me.

Alexander Kogan wrote:
> 
> Hmm,
> 
> Richard Backhouse wrote:
> > I have a cautionary tale for anyone who has an existing app with a web
> > component and an ejb component that runs with tomcat and jboss :
> >
> > Moral of the story : Be careful how you package the jar, war and ear
> > files.
> 
> I have a small library (just bunch of helper classes and
> interfaces)
> which is used by my ejbs and servlets. I included this library
> either
> in ejb-jars and WEB-INF/lib according to ejb and servlet
> specs.
> Running jboss with tomcat-embedded I got whole bunch of
> ClassNotFound,
> ClassCast and other exception. Even one ejb couldn't find
> another from
> different jar.
> Finally, only putting this library into jboss startup
> CLASSPATH resolved
> the problem.
> 
> Now, back to your story. Does it mean, that when tomcat and
> jboss
> share same VM, I have to put this library only once somewhere?
> Or it is another issue?
> 
> Thanks.
> 
> --
> _________________________________________________________
> Alexander Kogan    Parametric Technology Corporation
> [EMAIL PROTECTED]      128 Technology Drive, Waltham MA 02453
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to