I'm upgrading applications running over an in-house framework from JBoss4 to JBoss 5.1 and the framework gets the following trouble:
in WAR context, warClassLoader.getParent() returns null
whereas the framework expects to get a reference to the EAR ClassLoader which loads many EJB modules and Java modules (and includes also the WAR).
For details, the framework behaves differently for EJB components and for Servlet components. Its configuration entries are stored in META-INF/MANIFEST.MF. When Thread ContextClassLoader is warClassLoader, it lists all META-INF/MANIFEST.MF visible (listWAR) and excludes resources coming from EAR jar files (listEJB) by querying manifest resources from warClassLoader.getParent(). So it gets Servlet configuration set as "listWAR - listEJB".
JBoss 5.1 new ClassLoader layer now breaks this logic.
Is there a simple way to get warClassLoader.getParent() returns the EAR ClassLoader reference ?
I have tried classloading tags and metadata in WAR WEB-INF/lib/jboss-web.xml and WEB-INF/lib/jboss-classloading.xml without any success concerning "getParent" reference.
Thank you in advance for your help.
This behavior still exists in JBoss AS 6 and 7.
So I have added an ugly work-around to detect if a resource is in WAR or in EAR at EJB level based on URL resource name from the ClassLoader - like looking for "/WEB-INF/" in path.