getting FileNotFound Exception when viewing a page that uses my custom facelet-taglib
===

Here is my context :
--------------------

 - I'm using Netbeans as an IDE
 - richfaces 4 in my test webapp.
 - glassfish 3.1.2

Here is my detailed problem :
-----------------------------

 - I have a menu bar that I want to be able to reuse in several other pages.
 - I believe this is what facelet-taglibs are for so I want to create one.

Here is what I did :
--------------------

 - created the file containing my menu :
menu.xhtml

>     <?xml version='1.0' encoding='UTF-8' ?>
>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>     <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">
>         <h:body>
>             <ui:composition id="PAC-MENU">
>                 <rich:toolbar width="50%">
>                     <rich:dropDownMenu>
>                     <f:facet name="label"> 
>                         <h:panelGroup>
>                             <h:graphicImage value="./images/icons/create_doc.gif" styleClass="pic"/>
>                             <h:outputText value="Declaration"/>
>                         </h:panelGroup>
>                     </f:facet>
>     
>                     <rich:menuItem label="Upload" icon="${facesContext.externalContext.requestContextPath}/images/icons/create_doc.gif" action="/pages/uploadDeclarationBatch"/>
>                     </rich:dropDownMenu>
>                     <rich:toolbarGroup location="right">
>                         <rich:dropDownMenu label="Profile" direction="bottomLeft" jointPoint="bottomRight">
>                             <rich:menuItem label="Update" action="/pages/updateProfile"/>
>                             <rich:menuItem label="Change password" action="/pages/changePassword"/>
>                         </rich:dropDownMenu>
>                     </rich:toolbarGroup>
>                 </rich:toolbar>
>             </ui:composition>
>         </h:body>
>     </html>

 - created the taglib file :
pac-taglibs.xhtml
>     <?xml version='1.0'?>
>     <!DOCTYPE facelet-taglib PUBLIC
>       "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
>       "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
>     
>     <facelet-taglib version="2.0">
>         <namespace>http://www.myproduct.com/jsf</namespace>
>         <tag>
>             <tag-name>pac-menu</tag-name> 
>             <source>/resources/tags/menu.xhtml</source>
>         </tag>
>     </facelet-taglib>

 - Modified the web.xml y adding this :
web.xml
>     <context-param>
>          <param-name>javax.faces.FACELETS_LIBRARIES</param-name> 
>          <param-value>/resources/taglibs/pac-taglibs.xhtml</param-value>
>     </context-param>

 - referenced my taglib in my page and use the tag like this :
home.xhtml
>     <?xml version='1.0' encoding='UTF-8' ?>
>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>     <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">
>         <h:head>
>             <link rel="stylesheet" type="text/css" ref="${facesContext.externalContext.requestContextPath}/resources/css/styles.css"/>
>             <title>My Product V1.0 Beta</title>
>         </h:head>
>         <h:body styleClass="backGroundimage">
>             <center>
>                 <h:form>
>                     <h:outputText id="outtxt" styleClass="h1" value="Welcome ${pAC_USER.name}"/><BR/><BR/>
>                     <a3c:pac-menu/>
>                 </h:form>
>             </center>
>         </h:body>
>     </html>

 - here is the directory structure :

>     WebContent
>        |
>        ---> META-INF
>        |
>        ---> WEB-INF
>        |
>        ---> resources
>        |      |
>        |      ---> css
>        |      |
>        |      ---> taglibs
>        |      |      |
>        |      |      ---> pac-taglibs.xhtml
>        |      |      
>        |      ---> tags
>        |      |      |
>        |      |      ---> menu.xhtml
>        |     
>        ---> index.xhtml

and each time I try to access my page I've got this error message :

>     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)

I must confess myself lost. Im' very new to JSF so please by nice in your trolling (even though being new does not prevent me to RTFM or google, but I spent hours and did not find anything) :)

thanks in advance for any pointer you could give me so I can go to bed less of an idiot than I was ;).

Thanks again.

Take care,
Marco.

