No WebApplicationContext found: no ContextLoaderListener registered?报错解决
今天跑了下新搭的一个SSI框架。
报例如以下错误:
严重: Exception sending context initialized event to listener instance of class com.j.chat.upgrade.web.core.SystemLaunchListener
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:84)
at com.j.chat.upgrade.web.core.SystemLaunchListener.contextInitialized(SystemLaunchListener.java:27)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
2014-7-14 19:49:10 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
非常纳闷,我在web.xml里面已经声明了ContextLoaderListener 这个监听器。我的web.xml配置文件例如以下:
<listener>
<listener-class>com.j.chat.upgrade.web.core.SystemLaunchListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-config.xml</param-value>
</context-param>
分析了下。我是在SystemLaunchListener里面运行的时候。发现ContextLoaderListener 这个监听器没有注冊。难道是由于这两个listener是先后运行的?调了下这个两个监听器的顺序,把spring的监听器放在了最前面。
重新启动tomcat,就没有这个报错了。
网上搜了下web.xml文件中listener的运行顺序。以下是一个可信的说法:
在java web规范中说明.依照listner,filter,servlet的顺序初始化.
当中listener是依照在web.xml中的申明顺序运行的.不存在并发的的情况.
No WebApplicationContext found: no ContextLoaderListener registered?报错解决的更多相关文章
- No WebApplicationContext found: no ContextLoaderListener registered
修改前运行报错:No WebApplicationContext found: no ContextLoaderListener registered? <web-app> <dis ...
- MySQL5.7.26安装及启动报错解决
一.安装依赖包 [root@db01 ~]# yum install -y lrzsz [文件上传/下载] [root@db01 ~]# yum -y install xfsprogs [安装磁盘格式 ...
- sphinx :undefined reference to `libiconv' 报错解决办法
sphinx :undefined reference to `libiconv' 报错解决办法 2013-11-30 21:45:39 安装sphinx时不停报错...郁闷在make时报错,错误 ...
- redis运用连接池报错解决
redis使用连接池报错解决redis使用十几小时就一直报异常 redis.clients.jedis.exceptions.JedisConnectionException: Could not g ...
- linux下启动dbca或netmgr类的图形界面报错解决
linux下启动dbca或netmgr类的图形界面报错解决 Xlib: connection to ":0.0" refused by server Xlib: No pro ...
- CentOS 6.5 Maven 编译 Apache Tez 0.8.3 踩坑/报错解决记录
最近准备学习使用Tez,因此从官网下载了最新的Tez 0.8.3源码,按照安装教程编译使用.平时使用的集群环境是离线的,本打算这一次也进行离线编译,无奈一编译就开始报缺少jar包的错,即使手动下载ja ...
- spring boot jpa 使用update 报错解决办法
在spring boot jpa 中自定义sql,执行update操作报错解决办法: 在@Query(...)上添加 @Modifying@Transactional注解
- eclipse创建的maven项目,pom.xml文件报错解决方法
[错误一:]maven 编译级别过低 [解决办法:] 使用 maven-compiler-plugin 将 maven 编译级别改为 jdk1.6 以上: <!-- java编译插件 --> ...
- 搭建oracle linux虚拟机报错解决
sysctl -P 报错解决办法问题症状修改 linux 内核文件 #vi /etc/sysctl.conf后执行sysctl -P 报错error: "net.bridge.bridge ...
随机推荐
- shell-3.bash的基本功能:通配符和其他特殊字符
1. 2.
- 路飞学城Python-Day2
13.变量的定义规范 变量的含义:变量就是定义之后还能发生改变,可以重新赋值的量;变量的定义规范:名字不能随便起,声明一个变量,name = "123"[变量 = 值]变量定义规则 ...
- HDU 3046 Pleasant sheep and big big wolf
Pleasant sheep and big big wolf Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged ...
- COGS——T 803. [USACO Hol10] 政党 || 1776: [Usaco2010 Hol]cowpol 奶牛政坛
http://www.lydsy.com/JudgeOnline/problem.php?id=1776||http://cogs.pro/cogs/problem/problem.php?pid=8 ...
- Ubuntu ctrl+alt会导致窗口还原的问题
Ubuntu ctrl+alt会导致窗口还原的问题 本来以为是compizConfig的问题,后来在系统config中找到键盘>快捷键:恢复窗口,删除这个快捷键,就好了: 原来这里写的是ctrl ...
- nyoj914(二分搜索+贪心)
题目意思: pid=914">acm.nyist.net/JudgeOnline/problem.php?pid=914 如今有n个物品的重量和价值各自是Wi和Vi,你能帮他从中选出k ...
- CSS透明度设置支持IE,Chrome,Firefox浏览器
CSS文件里设置例如以下就可以 filter:alpha(opacity=60); //支持IE opacity:0.6; //支持Chrome.Firefox
- java9新特性-20-Javascript引擎升级:Nashorn
1.官方Feature 236: Parser API for Nashorn 292: Implement Selected ECMAScript 6 Features in Nashorn 2.使 ...
- jsp留言板雏形
编写一个简单的留言簿,实现添加留言和显示留言内容的功能 <%@ page language="java" contentType="text/html; chars ...
- AngularJs轻松入门源码托管至Github
Github是全球最大的代码托管平台,笔者玩Github有一段时间了,有很多开源项目的源码都托管在Github上,笔者在上面也发现了不少优秀的开源代码. 每次写完博文想在最后附上文章相关的代码,但是由 ...