缺乏DispatcherServlet解決辦法

信息: Starting Servlet Engine: Apache Tomcat/6.0.32
2012-3-31 9:39:40 org.apache.catalina.core.StandardContext listenerStart
嚴重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4148)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
 at org.apache.catalina.core.StandardService.start(StandardService.java:525)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)java

===============================================web

出現這一問題的緣由是tomcat再發布web項目時,並無將maven的依賴包一塊兒隨項目的編譯一併進行打包。spring

解決方案:(eclipse)apache

1.在項目上右擊 --> Propertiestomcat

2.選擇Deployment Assembly,在右邊點擊Add按鈕,在彈出的窗口中選擇Java Build Path Entriesapp

3.點擊Next,選擇Maven Dependencies(或者是選中pom.xml文件中規定的的全部依賴包)eclipse

4.點擊Finish,而後能夠看到已經把Maven Dependencies添加到Web應用結構中了maven

相關文章
相關標籤/搜索