java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered
2011-11-18 17:18
676 查看
报错信息:
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:70)
org.springframework.web.struts.DelegatingActionUtils.findRequiredWebApplicationContext(DelegatingActionUtils.java:148)
org.springframework.web.struts.DelegatingRequestProcessor.initWebApplicationContext(DelegatingRequestProcessor.java:134)
org.springframework.web.struts.DelegatingRequestProcessor.init(DelegatingRequestProcessor.java:114)
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:602)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
解决办法:
1、:发现原来它的配置文件不是放在WEB-INF下,而是放在src目录下,解决的方法:
1)将其spring的配置文件applicationContext转移阵地,转到WEB-INF下;
2)在web.xml下加入如下语句:
<!-- Spring ApplicationContext配置文件的路径,可使用通配符,多个路径用,号分隔此参数用于后面的Spring-Context loader -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml,classpath*:applicationContext*.xml</param-value>
</context-param>
2、再在web.xml里面加上这些
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:70)
org.springframework.web.struts.DelegatingActionUtils.findRequiredWebApplicationContext(DelegatingActionUtils.java:148)
org.springframework.web.struts.DelegatingRequestProcessor.initWebApplicationContext(DelegatingRequestProcessor.java:134)
org.springframework.web.struts.DelegatingRequestProcessor.init(DelegatingRequestProcessor.java:114)
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:602)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
解决办法:
1、:发现原来它的配置文件不是放在WEB-INF下,而是放在src目录下,解决的方法:
1)将其spring的配置文件applicationContext转移阵地,转到WEB-INF下;
2)在web.xml下加入如下语句:
<!-- Spring ApplicationContext配置文件的路径,可使用通配符,多个路径用,号分隔此参数用于后面的Spring-Context loader -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml,classpath*:applicationContext*.xml</param-value>
</context-param>
2、再在web.xml里面加上这些
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
相关文章推荐
- java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
- java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered
- No WebApplicationContext found: no ContextLoaderListener registered的解决方法
- No WebApplicationContext found: no ContextLoaderListener registered
- No WebApplicationContext found: no ContextLoaderListener registered的解决方法
- No WebApplicationContext found: no ContextLoaderListener registered的解决方法
- No WebApplicationContext found: no ContextLoaderListener or DispatcherServlet registered? at org.sp
- No WebApplicationContext found: no ContextLoaderListener registered?
- No WebApplicationContext found: no ContextLoaderListener registered的解决方法
- No WebApplicationContext found: no ContextLoaderListener registered?
- tomcat : Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException:
- No WebApplicationContext found: no ContextLoaderListener registered异常
- No WebApplicationContext found: no ContextLoaderListener registered 错误解决
- No WebApplicationContext found: no ContextLoaderListener registered?
- No WebApplicationContext found: no ContextLoaderListener registered?报错解决
- No WebApplicationContext found: no ContextLoaderListener registered错误
- 异常备忘:No WebApplicationContext found: no ContextLoaderListener registered
- No WebApplicationContext found: no ContextLoaderListener registered?报错解决
- No WebApplicationContext found: no ContextLoaderListener registered
- No WebApplicationContext found: no ContextLoaderListener registered?