4

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?

2 Answers2

1

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
  • 33,455
  • 4
  • 52
  • 58
1

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.
  • 147
  • 1
  • 1
  • 6