java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet

前端 未结 9 1340
温柔的废话
温柔的废话 2021-02-05 19:14

I am getting this error, when executing JSF and PrimeFaces.

I have included these jars,

  • jsf-api-2.0.3.jar,
  • jsf-impl-2.0.3.jar ,
  • jstl-1.0.
相关标签:
9条回答
  • 2021-02-05 19:28
    1. Download JAR's from here: http://myfaces.apache.org/download.html

    2. Copy them to TOMCAT lib directory.

    3. Add to Tomcat web.xml these lines from screenshot: listener

    0 讨论(0)
  • 2021-02-05 19:29

    You can also do this, which solved my problem.
    Right click on your project->properties->project facets->java server faces.

    Then if the disabled library configuration option has selected, then change it to user library and then add mojarra's latest version and press OK button and try run the project again...

    It should help.

    0 讨论(0)
  • 2021-02-05 19:34

    Apparently, you're not missing anything else. Just try to do the following:

    1. Ensure that the necessary jars exist in the "lib" project folder;
    2. Do clean & build;

    In the end, you should find those included jars, available within the "build" project folder.

    0 讨论(0)
  • 2021-02-05 19:43

    If you tried to convert your simple java project to web project using maven and changing specificications from project facets, you won't get a compile error but when you start deployment you can see this error message.

    to solve this think of it. This is a web project and needs to deploy as a war file (or ear).

    change packaging spec to war in your pom.xml then compile maven again.

    0 讨论(0)
  • 2021-02-05 19:45

    Right click on project properties and follow below steps

    "Project Properties" --> "Deployment Assembly", adding "Java Build Path Entries" ->jsf 2.0 (mojarra 2.0.3-fcs) solved my problems

    0 讨论(0)
  • 2021-02-05 19:46

    Adding below jars to path ..WebContent\WEB-INF\lib and a maven update solved the problem.

    • jsf-api

    • jsf-impl

    0 讨论(0)
提交回复
热议问题