maven ClassNotFoundException: org.springframework.web.context.ContextLoaderL

信息: 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)

2012-3-31 9:39:40 org.apache.catalina.core.StandardContext listenerStart

严重: Skipped installing application listeners due to previous error(s)

2012-3-31 9:39:40 org.apache.catalina.core.StandardContext start

严重: Error listenerStart

  

出现这一问题的原因是tomcat再发布web项目时,并没有将maven的依赖包一起随项目的编译一并进行打包。

解决方案:(eclipse)

1.在项目上右击 --> Properties

2.选择Deployment Assembly,在右边点击Add按钮,在弹出的窗口中选择Java Build Path Entries

3.点击Next,选择Maven Dependencies(或者是选中pom.xml文件中规定的的所有依赖包)

4.点击Finish,然后可以看到已经把Maven Dependencies添加到Web应用结构中了

你可能感兴趣的:(maven ClassNotFoundException: org.springframework.web.context.ContextLoaderL)