title: getting FileNotFound Exception when viewing a page that uses my custom facelet-taglib
body: <h2>Here is my context :</h2>
  
  <ul>
  <li>I'm using Netbeans as an IDE</li>
  <li>richfaces 4 in my test webapp.</li>
  <li>glassfish 3.1.2</li>
  </ul>
  
  <h2>Here is my detailed problem :</h2>
  
  <ul>
  <li>I have a menu bar that I want to be able to reuse in several other pages.</li>
  <li>I believe this is what facelet-taglibs are for so I want to create one.</li>
  </ul>
  
  <h2>Here is what I did :</h2>
  
  <ul>
  <li>created the file containing my menu :
  menu.xhtml</li>
  </ul>
  
  <blockquote>
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:ui="http://java.sun.com/jsf/facelets"&gt;
      &lt;h:body&gt;
          &lt;ui:composition id="PAC-MENU"&gt;
              &lt;rich:toolbar width="50%"&gt;
                  &lt;rich:dropDownMenu&gt;
                  &lt;f:facet name="label"&gt; 
                      &lt;h:panelGroup&gt;
                          &lt;h:graphicImage value="./images/icons/create_doc.gif" styleClass="pic"/&gt;
                          &lt;h:outputText value="Declaration"/&gt;
                      &lt;/h:panelGroup&gt;
                  &lt;/f:facet&gt;
  
                  &lt;rich:menuItem label="Upload" icon="${facesContext.externalContext.requestContextPath}/images/icons/create_doc.gif" action="/pages/uploadDeclarationBatch"/&gt;
                  &lt;/rich:dropDownMenu&gt;
                  &lt;rich:toolbarGroup location="right"&gt;
                      &lt;rich:dropDownMenu label="Profile" direction="bottomLeft" jointPoint="bottomRight"&gt;
                          &lt;rich:menuItem label="Update" action="/pages/updateProfile"/&gt;
                          &lt;rich:menuItem label="Change password" action="/pages/changePassword"/&gt;
                      &lt;/rich:dropDownMenu&gt;
                  &lt;/rich:toolbarGroup&gt;
              &lt;/rich:toolbar&gt;
          &lt;/ui:composition&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  </blockquote>
  
  <ul>
  <li><p>created the taglib file :
  pac-taglibs.xhtml</p>
  
  <blockquote>
  <pre><code>&lt;?xml version='1.0'?&gt;
  &lt;!DOCTYPE facelet-taglib PUBLIC
    "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
    "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"&gt;
  
  &lt;facelet-taglib version="2.0"&gt;
      &lt;namespace&gt;http://www.myproduct.com/jsf&lt;/namespace&gt;
      &lt;tag&gt;
          &lt;tag-name&gt;pac-menu&lt;/tag-name&gt; 
          &lt;source&gt;/resources/tags/menu.xhtml&lt;/source&gt;
      &lt;/tag&gt;
  &lt;/facelet-taglib&gt;
  </code></pre>
  </blockquote></li>
  <li><p>Modified the web.xml y adding this :
  web.xml</p>
  
  <blockquote>
  <pre><code>&lt;context-param&gt;
       &lt;param-name&gt;javax.faces.FACELETS_LIBRARIES&lt;/param-name&gt; 
       &lt;param-value&gt;/resources/taglibs/pac-taglibs.xhtml&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  </blockquote></li>
  <li><p>referenced my taglib in my page and use the tag like this :
  home.xhtml</p>
  
  <blockquote>
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:a3c="http://www.myproduct.com/jsf"&gt;
      &lt;h:head&gt;
          &lt;link rel="stylesheet" type="text/css" ref="${facesContext.externalContext.requestContextPath}/resources/css/styles.css"/&gt;
          &lt;title&gt;My Product V1.0 Beta&lt;/title&gt;
      &lt;/h:head&gt;
      &lt;h:body styleClass="backGroundimage"&gt;
          &lt;center&gt;
              &lt;h:form&gt;
                  &lt;h:outputText id="outtxt" styleClass="h1" value="Welcome ${pAC_USER.name}"/&gt;&lt;BR/&gt;&lt;BR/&gt;
                  &lt;a3c:pac-menu/&gt;
              &lt;/h:form&gt;
          &lt;/center&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  </blockquote></li>
  <li><p>here is the directory structure :</p></li>
  </ul>
  
  <blockquote>
  <pre><code>WebContent
     |
     ---&gt; META-INF
     |
     ---&gt; WEB-INF
     |
     ---&gt; resources
     |      |
     |      ---&gt; css
     |      |
     |      ---&gt; taglibs
     |      |      |
     |      |      ---&gt; pac-taglibs.xhtml
     |      |      
     |      ---&gt; tags
     |      |      |
     |      |      ---&gt; menu.xhtml
     |     
     ---&gt; index.xhtml
  </code></pre>
  </blockquote>
  
  <p>and each time I try to access my page I've got this error message :</p>
  
  <blockquote>
  <pre><code>java.io.FileNotFoundException
    at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:403)
    at com.sun.faces.facelets.impl.DefaultFaceletCache._getLastModified(DefaultFaceletCache.java:172)
    at com.sun.faces.facelets.impl.DefaultFaceletCache.access$000(DefaultFaceletCache.java:62)
    at com.sun.faces.facelets.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:82)
    at com.sun.faces.facelets.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:78)
    at com.sun.faces.util.ExpiringConcurrentCache$1.call(ExpiringConcurrentCache.java:99)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.sun.faces.util.ExpiringConcurrentCache.get(ExpiringConcurrentCache.java:114)
    at com.sun.faces.facelets.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:121)
    at com.sun.faces.facelets.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:62)
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:256)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:366)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:326)
    at com.sun.faces.facelets.tag.UserTagHandler.apply(UserTagHandler.java:142)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  </blockquote>
  
  <p>How is this caused and how can I solve it?</p>