title: java.lang.NoClassDefFoundError: javax/faces/context/FacesContext
body: <p>I have two web projects in Eclipse: Framework and webxxx</p>
  
  <p>In my framework I have some <code>utils</code> functions like copy, download, upload,etc...</p>
  
  <p>When I call download method from <code>webxxx</code> I got <code>*java.lang.NoClassDefFoundError: javax/faces/context/FacesContext*.</code></p>
  
  <p>If I move <code>GerenciarArquivo</code> class to webxxx project the downloadFile method works fine.</p>
  
  <p><strong>FRAMEWORK :</strong></p>
  
  <pre><code>public abstract class GerenciarArquivo{
  ...
  public static void downloadFile(String filePath) throws IOException{
      FacesContext context = FacesContext.getCurrentInstance();  
      HttpServletResponse response = (HttpServletResponse) context  
                           .getExternalContext().getResponse(); 
  </code></pre>
  
  <p><strong>WEBXXX PROJECT :</strong></p>
  
  <pre><code>GerenciarArquivo.downloadFile(abb.getPath());
  </code></pre>
  
  <p>Both projects has :</p>
  
  <p><img src="https://i.stack.imgur.com/pBfFQ.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/cReEz.png" alt="enter image description here"></p>
  
  <p><strong>Web xxx project Dependencies :</strong> </p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
          &lt;version&gt;6.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
          &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
          &lt;version&gt;3.5&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.primefaces.themes&lt;/groupId&gt;
          &lt;artifactId&gt;all-themes&lt;/artifactId&gt;
          &lt;version&gt;1.0.9&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
          &lt;version&gt;2.2.4&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
          &lt;version&gt;2.2.4&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;       
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.0-alpha-1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>Framework dependencies :</strong> </p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
          &lt;version&gt;6.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;4.1.9.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javassist&lt;/groupId&gt;
          &lt;artifactId&gt;javassist&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-lang&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
          &lt;version&gt;2.2&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>