maven项目启动Error configuring application listener of class org.springframework.web.context.ContextLoad
2017-02-18 03:07
906 查看
用maven 工程搭建项目,在搭建好之后,运行时却抛出了这样的错误: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener, 这说明根本没有找到我们在 web.xml 里面配置的 listener, 但maven 的pom.xml 里面已经配置相应的包,而且可以在java
工程的maven dependency jar 包里面找到, 这说明maven是没有问题的,在网上搜索了很多答案,最多的就是类似这个文章: http://www.cnblogs.com/zhouyalei/archive/2011/11/30/2268606.html 基本都是这样去解决,但是貌似对我来说不行,而且比较麻烦,需要修改
.project , .classpath 等文件。其实有更简单的办法.
在eclipse 里面, 参考如下配置:
![](http://www.yihaomen.com/attachments/month_1402/d201422111741.png)
1. 右键单击工程项目 ->点击 properties
2. 选择 Deployment Assembly
3. 点击 Add -> Java Build Path Entries -> Next
4. 选择 Maven Dependencies -> Finish -> Apply -> OK
5. Clean project and server. 重启server
这样就能解决maven 下找不到 spring listener 的问题。一个最明显的变化是你的web 工程里面明显多了一个jar包。
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener, 这说明根本没有找到我们在 web.xml 里面配置的 listener, 但maven 的pom.xml 里面已经配置相应的包,而且可以在java
工程的maven dependency jar 包里面找到, 这说明maven是没有问题的,在网上搜索了很多答案,最多的就是类似这个文章: http://www.cnblogs.com/zhouyalei/archive/2011/11/30/2268606.html 基本都是这样去解决,但是貌似对我来说不行,而且比较麻烦,需要修改
.project , .classpath 等文件。其实有更简单的办法.
在eclipse 里面, 参考如下配置:
![](http://www.yihaomen.com/attachments/month_1402/d201422111741.png)
1. 右键单击工程项目 ->点击 properties
2. 选择 Deployment Assembly
3. 点击 Add -> Java Build Path Entries -> Next
4. 选择 Maven Dependencies -> Finish -> Apply -> OK
5. Clean project and server. 重启server
这样就能解决maven 下找不到 spring listener 的问题。一个最明显的变化是你的web 工程里面明显多了一个jar包。
![](http://www.yihaomen.com/attachments/month_1402/w201422112056.png)
相关文章推荐
- maven管理的项目出现Error configuring application listener of class org.springframework.web.context.Context
- 构建maven的web项目时注意的问题(出现Error configuring application listener of class org.springframework.web.context.ContextLoaderListener 或者前端控制器无法加载)
- Eclipse运行Maven的SpringMVC项目Run on Server时出现错误:Error configuring application listener of class org.springframework.web.context.ContextLoaderListener的问题解决
- maven管理的项目出现Error configuring application listener of class org.springframework.web.context.ContextL
- Tomcat启动抛错——SEVERE: Error configuring application listener of class org.springframework.web.context.
- tomcat启动报错:Error configuring application listener of class org.springframework.web.context.ContextLo
- 求大神赐教严重: Error configuring application listener of class org.springframework.web.context.ContextLoad
- tomcat启动报错:Error configuring application listener of class org.springframework.web.context.ContextLo
- maven管理的项目出现Error configuring application listener of class org.springframework.web.context.ContextL
- maven 严重: Error configuring application listener of class org.springframework.web.context.ContextL
- 使用Maven构建javaWeb项目时,启动tomcat出错:严重: Error configuring application listener of class org.springframewo
- tomcat启动报错:Error configuring application listener of class org.springframework.web.context.ContextLo
- 启动服务器报错: 严重: Error configuring application listener of class org.springframework.web.context.Context
- 六年神贴【急!!tomcat启动报错:Error configuring application listener of class org.springframework.web.context.】
- maven管理的项目出现Error configuring application listener of class org.springframework.web.context.ContextL
- 使用Maven构建javaWeb项目时,启动tomcat出错:严重: Error configuring application listener of class org.springframewo
- tomcat启动报错:Error configuring application listener of class org.springframework.web.context.ContextLo
- 使用Maven构建javaWeb项目时,启动tomcat出错:严重: Error configuring application listener of class org.springframewo
- Error configuring application listener of class org.springframework.web.context.ContextLoaderListene
- 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderLi