Mohammad Ghasemi
Mohammad Ghasemi

Reputation:

classloading in JBOSS

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?

Upvotes: 4

Views: 4575

Answers (2)

vh.
vh.

Reputation: 147

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."

Upvotes: 1

Nick Holt
Nick Holt

Reputation: 34311

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.

Upvotes: 1

Related Questions