I have the same problem ! Both on JBoss 3.0.4 and 3.2RC2. I have been searching in the forums for several hours and have come to the conclusion that it is caused by that unified classloading thing :)
I can see the benefits for that class loading model but I can also see some huge disadvantages ...
It is possible, even more, it is very likely that you will have more then one deployment of the same jar file on the same application server. A lot of development teams have constructed clever design patterns and utility jars they use in every project. I work as a fulltime J2EE developer and I know I have done that. Sometime, due to some special reasons, these classes are not always identical although they have the same name.
When I have 10 ears deployed with struts in them and I want to make another ear but now with a new version of struts in it? Or with a new version of some EJB in it? With the unified class loading mechanism, I have to upgrade all those other project as well... Imagine you have to explain that to a customer ...
I may be wrong, but it seems that the unified classloading mechanism has solved a lot of internal jboss stuff and made some unique features possible but it has broken basic J2EE development in a serious way ... And to be honest, as a J2EE developer, I don't care how the server is internally developed. As long as it works and it runs my applications.
Another issue raised by using a unified classloader is that of static singletons. Okay, static singletons are a bad thing, even forbidden by the spec but be realistic, it is often the only easy and portable way to implement something. As long as the J2EE spec doesn't offer some kinf of ear/war local instance reachable from every ear/war component, we will have to use statics.
A possible solution to the static singleton problem is the use of MBean services. But hey, I develop J2EE applications, not JBoss applications !!! Believe it or not but I often run the same application both on Novell Application Server (formerly Silverstream) and JBoss with just the deployment plans (jboss-app.xml, jboss-web.xml, ...) replaced. I even code my applications to make sure they can run on several application servers.
I hope there is a solution to the above mentioned problems. I want to be able to use the ear loader (loader-repository) and to be able to call ejb's between those ears. Other app servers can do this, it is what J2EE is meant to do in the first place ...
I don't want to minimize JBoss. JBoss is a great app server!
Bavo De Ridder