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?

1

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, but why does this happen?
@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.
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.

Comments

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.

4 Comments

But I am not using any JSF in my application
Do you have others applications deployed on Tomcat?
Its working fine now. I uninstalled NetBeans with Tomcat and made a fresh project. But still i do not know what exactly was the reason behind the error
I tried creating a completely new maven project using struts2+hibernate, but still getting this error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.