This post originated from an RSS feed registered with Java Buzz
by Norman Richards.
Original Post: The JBoss UCL is the blink tag of J2EE servers
Feed Title: Orb [norman richards]
Feed URL: http://members.capmac.org/~orb/blog.cgi/tech/java?flav=rss
Feed Description: Monkey number 312,978,199
I like JBoss. It's a great application server, but I'm not always
happy the way they play fast and loose with the J2EE way of doing
things. Take for example one of the biggest sources of JBoss pain,
the UnifiedClassLoader. The UCL was supposed to simplify things. Why
worry about organizing your application correctly when you can just
shove all your jars off in the deploy directory. JBoss will take care
of making sure all your classes are visible everywhere you go. Who
needs manifests?
Unfortunately, it's pretty
easy for things to go wrong. When you have a shared classloader
in a place where you don't expect one, all sorts of chaos can (and
will) ensue. I believe the solution to Toby's problem is simple
enough. He needs to a jboss-app.xml descriptor to his ear file which
declares loader repository that will look to the ear file first before
looking out to the shared world.
That's just crazy. That's a pretty obscure way of saying that you
want classloading="j2ee" instead of
classloading="broken". But, let's look beyond the inelegant
configuration mechanism. What is really wrong here is that JBoss
ships out of the box with a classloading mechanism that encourages you
to develop sloppy non-portable applications.
It happened where I work. Because JBoss let's you be sloppy, one
of the developers did just that and gave us a tangled deployment image
that suffers from deploy order problems and is a nightmare to work
with. I hope I get some time to undo all the damage, but until then,
we are stuck with a messy non-standard install that makes me want to
go add blink tags to our HTML just for completeness.
Here is a quote
from Bill Burk on the topic: This is the default behavior
because our users demanded it. In JBoss, by default, there is a flat
classloading structure so that a class is visible by any component. I
myself found this quite refreshing since I had struggled with other
application server's parent-child delegation models in the past. It
was nice not to worry about Linkage or ClassCastExceptions. This is
what the flat classloading structure alleviates for you.
Personally, I find it refreshing when things work in the way I
expect. I haven't struggled with loading inother servers. J2EE
deployment is quite clunky, but once you figure it out you can count
on things working the same way on whatever J2EE environment you are
working on. Well, except JBoss...