我奮力解決以下異常:不斷得到拋出java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener
INFO: No Spring WebApplicationInitializer types detected on classpath
Apr 17, 2017 8:48:01 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class [email protected]a
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1465)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1310)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:531)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:513)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:141)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4756)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5288)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1390)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1380)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Apr 17, 2017 8:48:01 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Apr 17, 2017 8:48:01 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
我使用Maven和下面的依賴加入到解決這個,但沒有得到結果,仍然面臨同樣的問題。
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
我已經添加了maven依賴項。對於Spring和Hibernate,我添加了所有必需的依賴項。
參考這個問題(http://stackoverflow.com/questions/22938689/info-no-spring-webapplicationinitializer-types-detected-on-classpath) –
@vikram 1)請添加整個pom.xml這裏。 2)你在你的項目中使用JSF嗎? –
@PratikShah我沒有在我的項目中使用JSF。 PFB pom.xml –