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 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.