maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

时间:2023-03-08 15:15:26
maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

maven项目启动tomcat报错:

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

错误原因:

tomcat在发布项目的时候没有同事发布maven依赖所添加的jar包,tomcat找到需要的jar包,所以报了上述错误。

解决办法:

将maven依赖包添加到tomcat发布配置中。

eclipse中的配置方法:

选中项目,右击项目-》Properties -》Deployment Assembly    把maven依赖引用add进去就可以了。

重新启动项目ok!