The properties of each class loader specify which classes are loaded, the search path to load those classes, and the delegation policy. When a parent and child class loader are configured to load the same class, the delegation policy determines how version conflicts are resolved. The delegation policies are:
Parent First The child class loader delegates to its parent before trying to load the class itself. For example, if you specify Java package X in the class path of an EJB module and the class path of an application that contains the package, the application class loader loads classes in package X.
The Parent-First policy is the default. This setting avoids the overhead incurred by custom-loading multiple copies of the same class among sibling entities. This policy allows sharing of common utility classes used by components and Web applications. It also ensures that both caller and callee are using the same class definition for parameters passed in EJB local interface calls, which is required to avoid ClassCastException errors.
Child First The child class loader tries to load classes itself before delegating to the parent. Use this policy when you must load different versions of a class in different entities. To use this policy, set the Parent- First property to false.