title: Class Loading in Deployments in JBoss as 7
body: <p>Reading the documentation of redhat (<a href="https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/chap-Class_Loading_and_Modules.html" rel="nofollow">https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/chap-Class_Loading_and_Modules.html</a>) I found that the application server classloader 
  has a priority list when loading classes that are used to avoid any conflict between 
  loaded classes, The order is as below </p>
  
  <ul>
  <li><strong>Implicit dependencies</strong>.
  These are the dependencies that are added automatically by JBoss Enterprise Application Platform 6, such as the JAVA EE APIs. These dependencies have the highest class loader precedence because they contain common functionality and APIs that are supplied by JBoss Enterprise Application Platform 6.
  Refer to Section 3.7.1, “Implicit Module Dependencies” for complete details about each implicit dependency.</li>
  <li><strong>Explicit dependencies</strong>.
  These are dependencies that are manually added in the application configuration. This can be done using the application's MANIFEST.MF file or the new optional JBoss deployment descriptor jboss-deployment-structure.xml file.
  Refer to Section 3.2, “Add an Explicit Module Dependency to a Deployment” to learn how to add explicit dependencies.</li>
  <li><strong>Local resources</strong>.
  Class files packaged up inside the deployment itself, e.g. from the WEB-INF/classes or WEB-INF/lib directories of a WAR file.</li>
  <li><strong>Inter-deployment dependencies</strong>.
  These are dependencies on other deployments in a EAR deployment. This can include classes in the lib directory of the EAR or classes defined in other EJB jars.</li>
  </ul>
  
  <p>I tried to test this order by using a JSF webapp (rich faces) in my EAR archive
  My ear is as below :</p>
  
  <p>sample.ear</p>
  
  <p>--- sport.war</p>
  
  <p>--- mysql.jar</p>
  
  <p>--- lib</p>
  
  <ul>
  <li><strong>Usescase 1</strong> : I added the JSF jars under the webapp (<strong>sport.war/WEB-INF/lib</strong>): [<em>jsf-api-2.1.14.jar/jsf-impl-2.1.14.jar/portletbridge-api-3.1.2.Final.jar/portletbridge-impl-3.1.2.Final.jar</em>], the jboss server started well and I don't have any exception</li>
  <li><strong>Usescase2</strong>: I added the JSF jars under sample.ear/lib
  ==> When I start the jboss server I get an exception (it sounds that the application server loaded the module JSF provided by jboss <strong>Implicit dependencies</strong> instead of the one in my <strong>sample.ear/lib</strong>)</li>
  </ul>
  
  <p>I can't understand why in the <em>1srt usescase</em> the <strong>Class Loading Precedence</strong> is not respected while in the <em>2sd usescase</em> the <strong>Class Loading Precedence</strong> is respected?</p>
  
  <p>Could you please clarify me this point</p>
  
  <p><strong>ENV</strong></p>
  
  <ol>
  <li>JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8)</li>
  <li>JDK 6</li>
  </ol>