java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
Asked Answered
S

9

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.2.jar jars and
  • primefaces-2.2.RC2.jar

in the WEB-INF/lib folder.

Is there any jar I am missing?

Saveloy answered 26/3, 2014 at 10:31 Comment(0)
R
10

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.

Rico answered 29/3, 2014 at 10:38 Comment(0)
T
28

Right click on project properties and follow below steps

"Project Properties" --> "Deployment Assembly", adding "Java Build Path Entries" -> "Maven Dependencies" solves the problem!

Table answered 9/4, 2015 at 10:24 Comment(0)
R
10

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.

Rico answered 29/3, 2014 at 10:38 Comment(0)
R
4

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

Righteous answered 1/9, 2016 at 9:36 Comment(1)
I Was using maven, and adding maven dependencies through the Deployment Assembly worked for meWingover
S
2

I added jsf 2.0 & mojarra 2.0.3-fcs in POM and it fixed my problem.

     <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.4.0</version>
    </dependency>
Seise answered 11/3, 2020 at 13:14 Comment(0)
G
1

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.

Gobble answered 31/5, 2016 at 6:33 Comment(0)
B
0

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.

Beechnut answered 21/10, 2015 at 9:0 Comment(0)
A
0
  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

According answered 21/11, 2018 at 19:35 Comment(0)
F
0

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

  • jsf-api

  • jsf-impl

Foretime answered 11/3, 2019 at 18:4 Comment(0)
E
-1

I had a similar issue and solved after running Maven Update a couple of times when it finally solved the issue. Running only once was not enough because the jar file was still corrupt so you need to make sure it opens with any compression tool like winzip or gzip.

Elaboration answered 3/10, 2018 at 14:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.