samedi 21 mars 2015

java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered

I have only one application context file tradelc-servlet.xml. So I think ContextLoaderListener is not needed. But still I am getting the exception mentioned in the title


ClsEditBody.jsp



<%@ taglib prefix="spring" uri="http://ift.tt/18bwTB1"%>
<%@ taglib prefix="form" uri="http://ift.tt/IED0jK"%>
<%@ taglib prefix="logic" uri="http://ift.tt/QfKAz6" %>
<%@ taglib uri="/WEB-INF/tlc.tld" prefix="tlc" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>


<%
String titleKey="crp.cls.title." + request.getParameter("action");
%>
<c:set var="action">
<%= (String)request.getParameter("action") %>
</c:set>


<tlc:in parameter="action" value="modify;create">
<form:form>
<form:hidden path="ukey" />
.
.
.
.


web.xml



<!--CharsetFilter start-->

<filter>
<filter-name>Charset Filter</filter-name>
<filter-class>com.bankofny.inx.omx.lc.web.action.CharsetFilter</filter-class>
<init-param>
<param-name>characterEncoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>Charset Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!--CharsetFilter end-->

<listener>
<listener-class>com.bankofny.inx.omx.lc.web.util.SessionListener</listener-class>
</listener>

<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>tradelc</servlet-name>
<!-- Specify servlet class to use:
- Struts1.0.x: ActionComponentServlet
- Struts1.1: ActionServlet
- no Struts: TilesServlet
-->
<!-- <servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-class> -->
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- <servlet-class>com.bankofny.inx.omx.lc.web.action.DevlActionServlet</servlet-class> -->
<!-- <servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class> -->

<!-- Tiles Servlet parameter
Specify configuration file names. There can be several comma
separated file names
-->
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</init-param>


<!-- Tiles Servlet parameter
Specify Tiles debug level.
O : no debug information
1 : debug information
2 : more debug information
-->
<init-param>
<param-name>definitions-debug</param-name>
<param-value>1</param-value>
</init-param>

<!-- Tiles Servlet parameter
Specify Digester debug level. This value is passed to Digester
O : no debug information
1 : debug information
2 : more debug information
-->
<init-param>
<param-name>definitions-parser-details</param-name>
<param-value>0</param-value>
</init-param>

<!-- Tiles Servlet parameter
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header.
false : no validation
-->
<init-param>
<param-name>definitions-parser-validate</param-name>
<param-value>true</param-value>
</init-param>


<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>

<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>

<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>

<load-on-startup>2</load-on-startup>


</servlet>

<servlet-mapping>
<servlet-name>tradelc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>



<session-config>
<session-timeout>21</session-timeout>
</session-config>

<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<error-page>
<exception-type>com.bankofny.inx.omx.lc.web.exceptions.LockException</exception-type>
<location>/errors/LockError.jsp</location>
</error-page>

<!-- Struts Tag Library Descriptor -->
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>


</web-app>


tradelc-servlet.xml



<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:context="http://ift.tt/GArMu7"
xmlns:p="http://ift.tt/1jdM0fE"
xmlns:mvc="http://ift.tt/1bHqwjR"
xsi:schemaLocation="http://ift.tt/GArMu6
http://ift.tt/1cnl1uo
http://ift.tt/GArMu7
http://ift.tt/1ldEMZY
http://ift.tt/1bHqwjR
http://ift.tt/1kF4x7W">

<context:annotation-config />
<!-- Scans within the base package of the application for @Components to configure-->
<context:component-scan base-package="com.bankofny.inx.omx.lc.web.actions" />

<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven />

<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="resources.application" />
</bean>


<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>


Exception:



org.apache.jasper.JasperException: An exception occurred processing JSP page /cls/ClsEdit.jsp at line 12

org.apache.jasper.JasperException: An exception occurred processing JSP page /cls/ClsEditBody.jsp at line 17

14:
15:
16: <tlc:in parameter="action" value="modify;create">
17: <form:form>
18: <form:hidden path="ukey" />
19: <!-- OMX00003517 UAT: June 2009: Invalid Password JavaScript Issue Start -->
20: <input type="hidden" name="password1" value="">


Stacktrace:



java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:89)
org.springframework.web.servlet.support.RequestContextUtils.getWebApplicationContext(RequestContextUtils.java:89)
org.springframework.web.servlet.support.RequestContext.initContext(RequestContext.java:237)
org.springframework.web.servlet.support.JspAwareRequestContext.initContext(JspAwareRequestContext.java:74)
org.springframework.web.servlet.support.JspAwareRequestContext.<init>(JspAwareRequestContext.java:48)
org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77)
org.apache.jsp.cls.ClsEditBody_jsp._jspx_meth_form_005fform_005f0(ClsEditBody_jsp.java:241)
org.apache.jsp.cls.ClsEditBody_jsp._jspx_meth_tlc_005fin_005f0(ClsEditBody_jsp.java:214)
org.apache.jsp.cls.ClsEditBody_jsp._jspService(ClsEditBody_jsp.java:155)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
org.apache.jsp.cls.ClsEdit_jsp._jspService(ClsEdit_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
com.bankofny.inx.omx.lc.web.action.CharsetFilter.doFilter(CharsetFilter.java:45)

Aucun commentaire:

Enregistrer un commentaire