您的位置:首页 > 编程语言 > Java开发

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

2016-10-28 22:41 411 查看
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener


1.背景:

maven项目迁移 、使用eclipse的maven update功能、更换(或者删除后添加)eclipse下面的tomcat服务器时,

2.启动时一般会出现以下问题:

   ①找不到监听器:

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener,一般网上的方法都是说jar没有找到,或者web.xml配置错误

  ② 不能找到action对应的类:

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [com.oa.action.BooksAction] for bean with name
'booksAction' defined in ServletContext resource,一般网上的方法都是struts2文件配置错误

3.解决方法:

 项目 —> 属性 -> Deployment Assembly -> Add -> Java Build Path Entries -> 选择Maven Dependencies -> Finish -> OK 把对应的Maven依赖包也发布到tomcat
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐