intellij idea: Error configuring listener org.springframework.web.context.ContextLoaderListener
来源:互联网 发布:win7 数据恢复 编辑:程序博客网 时间:2024/06/05 18:48
严重: Error configuringapplication listener of classorg.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener
atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... ...
intellij idea 部署spring web项目到tomcat时出现上述错误,现在网上的答案大多数都是错误的,希望我的解决方法能够帮助大家。
先说说为什么会报这样的错,将项目部署到tomcat的时候,项目中没有包含所需要的jar包,tomcat找不到所需的jar包,就报了ClassNotFoundException错。
但是如果直接往tomcat目录下的lib文件夹里放入所需的jar包的话,可能出现一些奇怪的错误(当然也可能直接就解决了)。
不建议直接往tomcat的lib目录下放jar包,而应该是将jar包在编译时包含到项目中。
因此要做的就是编译项目时包含所需的jar。
解决的方法为:File -> Project Structure -> Artifacts
下图右下角点一下Fix,将所需的jar包加入到artifact
重新编译应该就能运行。
如果你用intellij idea直接创建一个SpringMVC项目,而不是使用maven的话,浏览器弹出的窗口可能显示404,因为web.xml中servlet-mapping的url-pattern默认是*.form
<servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.form</url-pattern> </servlet-mapping>
应改成:
<servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
这样重新编译运行之后,弹出的浏览器窗口应该就能正常显示页面了。
- intellij idea: Error configuring listener org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- Spring异常:Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.
- Intellij IDEA 启动项目ClassNotFoundException:org.springframework.web.context.ContextLoaderListener
- Spring 配置问题还是代码问题?Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- 异常:configuring application listener of class org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.….ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.Context
- 启动服务器报错: 严重: Error configuring application listener of class org.springframework.web.context.Context
- maven管理的项目出现Error configuring application listener of class org.springframework.web.context.Context
- [Spring]error: org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.ContextLoaderListene
- mysql主主复制配置
- java多线程:15、阻塞队列【BlockingQueue】
- decimalformat
- rapidxml 文件读写、增加、删除、编辑节点
- SPOJ 2829 TLE
- intellij idea: Error configuring listener org.springframework.web.context.ContextLoaderListener
- 简单Node.js搭建本地站点
- Miracast与Wi-Fi Direct技术简介
- Spring注解 @Component、@Controller、@Service、@Repository
- Java开发环境的配置(Android/Java开发的第一步)
- iOS常用宏定义
- cocos-2d-x学习笔记
- Spring(十一):配置DataSource
- AR多标签识别程序1