ClassNotFoundException:com.sun.faces.config.ConfigureListener - 将jar部署到Eclipse下配置的Tomcat

时间:2013-05-23 05:57:22

标签: java eclipse tomcat deployment classnotfoundexception

我遇到的问题非常类似于:

  1. java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener when using MyFaces with WASCE/Geronimo
  2. java.lang.ClassNotFoundException : com.sun.faces.config.ConfigureListener
  3. Error with Jboss while deploying a jsp/servlet web app "com.sun.faces.config.ConfigureListener" Error
  4. 我设法找到了解决方法,但仍未解决问题。

    当我将我的应用程序部署到Eclipse Juno Service Release 1(Build id:20120920-0800)中配置的Tomcat 7.0.34时,我得到:

    INFO: Starting Servlet Engine: Apache Tomcat/7.0.34
    maj 22, 2013 5:10:34 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\ProjName\Workspaces\projname-eclipse-ws\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\4.0.1\WEB-INF\lib\javaee-api-6.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    maj 22, 2013 5:10:34 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\ProjName\Workspaces\projname-eclipse-ws\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\4.0.1\WEB-INF\lib\javax.servlet-3.2-b05.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    maj 22, 2013 5:10:36 PM org.apache.catalina.core.StandardContext listenerStart
    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:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    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)
    

    我已检查过我的web.xml,但我没有任何与 ConfigureListener 相关的条目。

    我将javaee-api-6.0.jar和javax.servlet-3.2-b05.jar设置为提供。解决方法是我从 C:\ ProjName \ Workspaces \ projname-eclipse-ws.metadata.plugins \ org.eclipse.wst.server.core \ tmp0 \ wtpwebapps \ 4.0.1 \ WEB中删除两个罐子通过Eclipse部署应用程序后,-INF \ lib

    我的问题是为什么Eclipse将这些jar部署到Tomcat而不管将其范围设置为提供?还有其他控制罐子部署的地方吗?

1 个答案:

答案 0 :(得分:0)

你的lib-faces-sources-1.2.0.09.jar中有jar吗?

如果没有,则将其添加到您的项目中。你可以从这里下载 - http://www.java2s.com/Code/Jar/c/Downloadcomspringsourcecomsunfacessources12009jar.htm