We use jboss-app.xml in META-INF folder of EAR file to restrict classes to be loaded only by the application's ClassLoader.
Like this: <jboss-app> | <loader-repository>mypackage:loader=myapp.ear</loader-repository> | </jboss-app> It works fine in Jboss 3.0.x. But we had a ClassCastException problem on looking up the configured DataSource from JNDI context. We had the problem when trying to cast the reference within a Delegate's method placed in a JAR on WEB-INF/lib directory of the web application and also within a Session Bean in the EJB container. After a few debugging tests, we came up with the fact that ClassLoaders for javax.sql.DataSource.class were different for the reference coming from JNDI context and that which was collocated to the Delegate or Session Bean. Debugging output looked like this: javax.sql.DataSource.class.getClassLoader(): [EMAIL PROTECTED] url=file:/C:/jboss3.2.3/server/default/tmp/deploy/tmp40857myapp.ear ,addedOrder=37} ds.getClass().getClassLoader(): [EMAIL PROTECTED] url=file:/C:/jboss3.2.3/server/default/tmp/deploy/tmp40781jboss-service.xml ,addedOrder=2} We deleted <loader-repository> element from META-INF/jboss-app.xml so the lookup and casting both succeeded. But we need the jboss-app.xml configuration in order to isolate legacy applications we developed and deployed on the same app server with different versions of the same class. Is there anything we can do? Is it a bug or an expected behaviour of JBoss ClassLoader architeture? Thanks, Eduardo Gouvea. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3837410#3837410 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3837410 ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user