Note that there are some explanatory texts on larger screens.

plurals
  1. POSecurity error while modifying web.xml
    text
    copied!<p>I am new to Spring MVC, trying to implement Spring Security features. When I modify the <code>web.xml</code> file I get this kind of error in Catalina log:</p> <pre><code>27.11.2012 9:49:21 org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart </code></pre> <p>The <code>web.xml</code> file is:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt; &lt;!-- The definition of the Root Spring Container shared by all Servlets and Filters --&gt; &lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/spring/root-context.xml /WEB-INF/spring/appServlet/security-context.xml &lt;/param-value&gt; &lt;/context-param&gt; &lt;filter&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;!-- Creates the Spring Container shared by all Servlets and Filters --&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;!-- Processes application requests --&gt; &lt;servlet&gt; &lt;servlet-name&gt;app&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/spring/appServlet/app-servlet.xml&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;app&lt;/servlet-name&gt; &lt;url-pattern&gt;/&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;default&lt;/servlet-name&gt; &lt;url-pattern&gt;*.gif&lt;/url-pattern&gt; &lt;url-pattern&gt;*.png&lt;/url-pattern&gt; &lt;url-pattern&gt;*.js&lt;/url-pattern&gt; &lt;url-pattern&gt;*.css&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;!--CharsetFilter start--&gt; &lt;filter&gt; &lt;filter-name&gt;CharsetFilter&lt;/filter-name&gt; &lt;filter-class&gt;kz.bimash.FoodSec.filters.CharsetFilter&lt;/filter-class&gt; &lt;init-param&gt; &lt;param-name&gt;requestEncoding&lt;/param-name&gt; &lt;param-value&gt;UTF-8&lt;/param-value&gt; &lt;/init-param&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;CharsetFilter&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;redirect.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; </code></pre> <p>This code gives me an error, but when I tried to remove the Spring Security configuration part, it started to work fine. Could you correct my errors in <code>web.xml</code>?</p> <p>Here is the Apache log file:</p> <pre><code>27.11.2012 10:57:37 org.apache.catalina.util.LifecycleBase stop INFO: The stop() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/foodsec]] after stop() had already been called. The second call will be ignored. 27.11.2012 10:57:38 org.apache.catalina.startup.HostConfig deleteRedeployResources INFO: Undeploying context [/foodsec] 27.11.2012 10:57:38 org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor C:\Program Files\Apache Software Foundation\tomcat7\conf\Catalina\localhost\foodsec.xml 27.11.2012 10:57:45 org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart 27.11.2012 10:57:45 org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/foodsec] startup failed due to previous errors </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload