Q:

JSF 2.0 composite components not working

I wanted to introduce CCs in my project. I am running Java EE 6 on JBoss 7.1.1.
/myProj/src/main/webapp/composites/scheda.xhtml:
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:composite="http://java.sun.com/jsf/composite">

    <composite:interface>
        <composite:attribute name="prod" />
    </composite:interface>

    <composite:implementation>
        Hello!
    </composite:implementation>

</html>

/myProj/src/main/webapp/someDir/page.xhtml:
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:composites="http://java.sun.com/jsf/composite/composites"
   template="/templates/default.xhtml">

    <ui:define name="content">

        <p:dialog 
            header="Scheda" 
            widgetVar="schedaDialog" 
            id="schedaDialogId">

            <composites:scheda prod="test" />

        </p:dialog>

    </ui:define>

</ui:composition>

This results in:

javax.servlet.ServletException: /.../page.xhtml 
  Tag Library supports namespace:
  http://java.sun.com/jsf/composite/composites, but no tag was defined
  for name: scheda

Some bug?

A:

You didn't put your xhtml of composite component in the right place. As I can see you are using Maven so proper path to your composite component should be:
/myProj/src/main/webapp/resources/composites/scheda.xhtml

resources is the folder where JSF looks for composite components.

