views:

577

answers:

3

Hi

If we have a A.jar that contains B.class and this file is located in JBOSS/server/default/lib and WEB-INF/lib of an EAR file. We have java2ParentDelegation is turned off. if we want to load the B.class which one will be loaded?

what if java2ParentDelegation is turned on?

A: 

Check out my answer to a very similar question

http://stackoverflow.com/questions/1157313/jboss-scoped-class-loading/1158045#1158045

skaffman
A: 

EAR files don't support WEB-INF/lib, WAR files do.

If you a mean the WEB-INF/lib of a WAR contained in an EAR then, by default, the class from the JAR in the WEB-INF/lib of the WAR 'should' be used.

With regards to the effect of java2ParentDelegation see the link @skaffman has posted.

Nick Holt
Hi Nick.that was my question,Thanks for your response !!!
+1  A: 

See case 3 in this wiki page: http://www.jboss.org/community/wiki/JBossClassLoadingUseCases

"Case 3. The Utility.class is present both in the application's archive AND server/default/lib. The deployment is scoped and Java2ParentDelegation is turned off (default).

The short story: The utility class is loaded from the application's archive."

vh