6

I have a web application in struts2 framework in NetBeans 7.0.1. it was working fine. But suddenly the Tomcat has started to give the following error:

SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

Any help?

Manoj
  • 5,542
  • 9
  • 54
  • 80
  • possible dup : http://stackoverflow.com/questions/11777844/java-lang-classnotfoundexception-com-sun-faces-config-configurelistener-when-us – Nandkumar Tekale Sep 18 '12 at 14:58

3 Answers3

9

Had the same problem. You probably used NetBeans to auto add this dependency with default 'compile' scope and it broke tomcat:

   <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>6.0</version>
    </dependency>

Use provided scope like here https://stackoverflow.com/a/10156854/1051834 If it does not help install a fresh tomcat and redeploy your project once again.

Community
  • 1
  • 1
Radek Busz
  • 313
  • 4
  • 12
  • Thanks, but why does this happen? – Koray Tugay Oct 19 '13 at 21:41
  • 1
    @KorayTugay: javaee-api jar needs jsf jars so if you add javaee-api jar in your project, you have to add jsf jar also. Thus, either adding jsf jars or removing javaee-api jar at run time (giving provided scope) will solve this problem. "Provided" scope in maven means you need the JAR for compiling, but at run time there is already a JAR provided by the environment so you don't need it packaged with your app so it won't be copied in lib folder. – Mital Pritmani Feb 03 '14 at 06:25
3
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.6</version>

is worked for me, you can change version as it release new versions.

tolgayilmaz
  • 3,987
  • 2
  • 19
  • 19
1

The jsf-implementation library is missing in your application (it should be in WEB-INF\lib\ directory of application). If you are starting application from Netbeans, this library (jsf-impl.jar?) is configured in classpath of Netbeans project, so there was no error.

tomi
  • 706
  • 1
  • 6
  • 21