Guys,

The latest in my efforts to pass the web integration
test suite.

I was getting nasty errors when trying to make
optimised calls from the web to the ejb container.

It seems that while JBoss is aware that both client
and server objects exist within the same vm, it was
upset that the call was being serialised, instead of
just simply made natively, and wanted to tell me about
it.

So I investigated....

Along the path that an invocation must make from web
to ejb container a test (Class.isAssignableFrom()) is
made to establish whether the call can be made between
two ClassLoaders without serialisation.

This test was failing.

I looked closer.

Jetty has 2 modes in which it can run the ClassLoader
used for WebApps.

1. Java 2 compliant - all requests for classes are
delegated first to it's parent. 

Using this strategy you may get bitten if your webapp
uses e.g. different versions of the same
infrastructure than it's container - since the
container's copies will be used in preference.
Problems also occur with abstract APIs (e.g. JAXP),
loaded by the container, looking for implementations
which the webapp contains, but the container does not
ship with.

2. Non-compliant - only requests for system classes
are passed upwards.

This strategy resolves the problems listed against (1)
but causes the isAssignableFrom() test mentioned above
to fail. What appears to happen is that JBoss passes
ClassLoader A to the EJB container which loads class X
then on to Jetty which creates it's WebApp
ClassLoader, B, as a child of A, then asks B to load
class X. B does not delegate to A, but loads class A
for a second time.


So I am caught in a bit of a quandarry - I want to
have my cake and eat it !

I could go off into a corner and try to write an even
cleverer ClassLoader for Jetty WebApps, which tried to
second-guess what was going on in JBoss or I can ask
you two guys to put your heads together and find a way
to coordinate the ClassLoader boundaries of the two
containers to my satisfaction!

Scott, If you could explain a little about the
architecture of ClassLoaders in JBoss3, Greg and I may
be in a better position to figure out how to get this
going.

Greg, I guess we are looking at pluggable
ContextLoader strategies - stand-alone, jboss etc...

WebSphere seems to have a highly configurable
ClassLoader system, and I think it is unlikely that
there is a one-size-fits-all solution here.

Sorry to complicate your mornings guys,


Jules


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music 
Charts
http://uk.my.yahoo.com

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to