Por que meu Apache Tomcat roda projetos JSP, mas dá erro com projetos JSF?

Sempre que rodo um projeto JSP no Netbeans com o Apache Tomcat, ele roda normalmente, mas quando faço o mesmo com um projeto JSF, ele dá erro e não roda.

Estou usando o Netbeans 13, Apache Tomcat 10.0.20, JDK 11.0.15.1.

Os JARs incluídos no projeto JSF são:

primefaces-5.3.jar
jsf-api-2.1.9.jar
jsf-impl-2.1.9.jar

O arquivo web.xml está assim:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsf</welcome-file>
    </welcome-file-list>
    <security-constraint>
        <display-name>Restrict raw XHTML Documents</display-name>
        <web-resource-collection>
            <web-resource-name>XHTML</web-resource-name>
            <url-pattern>*.xhtml</url-pattern>
        </web-resource-collection>
        <auth-constraint/>
    </security-constraint>
</web-app>

Sempre que tento executar ele mostra o seguinte erro no output do Netbeans:

Incrementally deploying hxxp://localhost:8080/TesteJSF
Completed incremental distribution of hxxp://localhost:8080/TesteJSF
Incrementally redeploying hxxp://localhost:8080/TesteJSF
Deploy is in progress…
deploy?config=file%3A%2FC%3A%2FUsers%2Feu%2FAppData%2FLocal%2FTemp%2Fcontext16680203248241000427.xml&path=/TesteJSF
FAIL - Deployed application at context path [/TesteJSF] but context failed to start
C:\Projetos\Java\TesteJSF\nbproject\build-impl.xml:1062: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 5 seconds)

Já tentei executar o Netbeans como administrador, tentei compilar o WAR e jogar na pasta webapps do Apache Tomcat e nada funcionou.

Precisa ver esses logs pra saber o que eh o problema.

Upei o log nesse site aqui: http://www.fileconvoy.com/dfl.php?id=g8de7c433b4fd28b4100042959584001677a8bf2f21

A URL eh bloqueada aqui na empresa. Não consigo abrir.
Mas logo alguém do fórum deve dar uma olhada lá.

Não consegui upar o log por aqui, por restrição a usuários novos.

Tente rodar no tomcat 9 pois, a partir do tomcat 10, os pacotes das classes do java EE mudaram de javax.* para jakarta.* por conta do projeto estar sendo mantido pela Eclipse Foundation.

FONTE: Apache Tomcat® - Apache Tomcat 10 Software Downloads

1 curtida