Maven+spring 报错:Error configuring application listener of class org.springframework.web.context.Cont

Maven+spring 报错:Error configuring application listener of class org.springframework.web.context.ContextLoaderListener,错误页面如下图:Maven+spring 报错:Error configuring application listener of class org.springframework.web.context.Cont

错误原因:web项目中一般都需要将java文件以及资源文件发布到指定位置,其中deployment assembly的作用就在于此,出现上述错误的原因是项目中需要的maven库(即pom.xml配置的jar包)没有被包含到部署程序集deployment assembly中,所以项目编译失败。

 

解决方案:

1. 打开Propertier工程属性对话框,到Deployment Assembly页面,点击Add 

Maven+spring 报错:Error configuring application listener of class org.springframework.web.context.Cont

2. 选择Jave Build Path Entries,然后点next

Maven+spring 报错:Error configuring application listener of class org.springframework.web.context.Cont

3. 选中Maven Dependencies,点击Finish,把程序使用的Library加入进来

Maven+spring 报错:Error configuring application listener of class org.springframework.web.context.Cont

4.重新运行Server,该错误不再出现。