title: JSF 2.0 composite component into jar
body: <p>I'm trying create a composite component to use across my projects, so, I've created a project called "componentes-ui-web" and putted 2 xhtml files that are my components.</p>
  
  <p>The structure of the project is like this:</p>
  
  <pre><code>src
  &gt; |-&gt; main
  &gt; &gt;       |-&gt;java
  &gt; &gt;          |-&gt;META-INF
  &gt; &gt;              |-&gt;faces-config.xml
  &gt; &gt;              |-&gt;resources
  &gt; &gt;                    |-&gt;componentes
  &gt; &gt;                           |-&gt;popupSimples.xhtml
  &gt; &gt;                           |-&gt;popupSubmit.xhtml
  </code></pre>
  
  <p>This is the code of <code>popupSubmit.xhtml</code>:</p>
  
  <pre><code>&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:ui="http://java.sun.com/jsf/facelets"
          xmlns:icecore="http://www.icefaces.org/icefaces/core"
          xmlns:ice="http://www.icesoft.com/icefaces/component"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:c="http://java.sun.com/jsp/jstl/core"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:composite="http://java.sun.com/jsf/composite"
          xmlns:ace="http://www.icefaces.org/icefaces/components"&gt;
      &lt;composite:interface&gt;
          &lt;composite:attribute name="modal" default="false" /&gt;
          &lt;composite:attribute name="visivel" default="false" /&gt;
          &lt;composite:attribute name="style" default="" /&gt;
          &lt;composite:attribute name="titulo" default="Sem título definido" /&gt;
          &lt;composite:attribute name="exibidoQuandoTipoUsuario" default="" /&gt;
          &lt;composite:attribute name="metodoFechar"
          method-signature="java.lang.Void fechar()" required="true" /&gt;
          &lt;composite:attribute name="metodoSubmeter"
          method-signature="java.lang.Void submeter()" required="true" /&gt;
          &lt;composite:facet name="conteudo" /&gt;
      &lt;/composite:interface&gt;
      &lt;composite:implementation&gt;
          &lt;h:form&gt;
              &lt;ice:panelPopup modal="#{cc.attrs.modal}"
                      renderedOnUserRole="#{cc.attrs.exibidoQuandoTipoUsuario}"
                      draggable="#{cc.attrs.modal}" rendered="#{cc.attrs.visivel}"
                      clientOnly="true" autoCentre="true" style="#{cc.attrs.style}"&gt;
                  &lt;f:facet name="header"&gt;
                      &lt;ui:insert name="barraDeTitulos"&gt;
                          &lt;ice:panelLayout layout="flow" style="width:100%"&gt;
                              &lt;h:outputText value="#{cc.attrs.titulo}" style="float:left" /&gt;
                              &lt;h:commandLink value="[X]" style="float:right"
                                  action="#{cc.attrs.metodoFechar}" immediate="true" /&gt;
                          &lt;/ice:panelLayout&gt;
                      &lt;/ui:insert&gt;
                  &lt;/f:facet&gt;
                  &lt;f:facet name="body"&gt;
                      &lt;ice:panelLayout layout="flow" style="width:100%"&gt;              
                          &lt;composite:renderFacet name="conteudo" /&gt;
                          &lt;ui:insert name="barraDeBotoes"&gt;
                              &lt;ice:panelLayout layout="flow"&gt;
                                  &lt;ace:pushButton value="CANCELAR" immediate="true"
                                      style="float:right" action="#{cc.attrs.metodoFechar}" /&gt;
                                  &lt;ace:pushButton value="OK" style="float:right"
                                      action="#{cc.attrs.metodoSubmeter}" /&gt;
                              &lt;/ice:panelLayout&gt;
                          &lt;/ui:insert&gt;
                      &lt;/ice:panelLayout&gt;
                  &lt;/f:facet&gt;
              &lt;/ice:panelPopup&gt;
          &lt;/h:form&gt;
      &lt;/composite:implementation&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In another Web project I try to use this component simply adding that jar to the lib (maven) and adding the  tag:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:icecore="http://www.icefaces.org/icefaces/core"
  xmlns:ice="http://www.icesoft.com/icefaces/component"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:c="http://java.sun.com/jsp/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:hrgi="http://java.sun.com/jsf/composite/componentes"
  xmlns:ace="http://www.icefaces.org/icefaces/components"&gt;
  &lt;ui:component&gt;
      &lt;f:loadBundle basename="com.hrgi.web.configuracoes.messages"
      var="configuracoesMsg" /&gt;   
          &lt;hrgi:popupSubmit modal="true" visivel="true"
      titulo="#{configuracoesMsg['popup.importador_nfe.titulo']}"
      exibidoQuandoTipoUsuario="ROLE_ADMINISTRADOR"
      metodoFechar="#{controladorPopupConfiguracaoImportadorNFe.fechar}"
      metodoSubmeter="#{controladorPopupConfiguracaoImportadorNFe.submeter}"&gt;
      &lt;f:facet name="conteudo"&gt;
            ...
      &lt;/hrgi:popupSubmit&gt;
  &lt;/ui:component&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I run the application, the component isn't shown and I receive this message in the firefox:</p>
  
  <blockquote>
    <p>Warning: This page calls for XML namespace <a href="http://java.sun.com/jsf/composite/componentes" rel="nofollow noreferrer">http://java.sun.com/jsf/composite/componentes</a> declared with prefix hrgi but no taglibrary exists for that namespace. </p>
  </blockquote>
  
  <p>What I did wrong??</p>
  
  <hr>
  
  <p><strong>Update</strong> thanks for the replies and sorry for the late to answer...</p>
  
  <p>I've created the ResourceResolver like BalusC told, but without success.
  I've checked the output of tomcat too, but didn't find any error.</p>
  
  <p>This is my <code>web.xml</code> file, perhaps someone can find anything that could help me.
  I will search about ResourceHandler too.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
          version="3.0"&gt;
      &lt;display-name&gt;teste-zk&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/icefaces/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.FACELETS_RESOURCE_RESOLVER&lt;/param-name&gt;
          &lt;param-value&gt;com.hrgi.web.ui.FaceletsResourceResolver&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
          &lt;param-value&gt;server&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;com.sun.faces.enableMissingResourceLibraryDetection&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
          &lt;param-value&gt;Development&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.FACELETS_SKIP_COMMENTS&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.VALIDATE_EMPTY_FIELDS&lt;/param-name&gt;
          &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/context-param&gt;    
      &lt;servlet&gt;
          &lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.icesoft.faces.webapp.CompatResourceServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/xmlhttp/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>