Announcement Announcement Module
Collapse
No announcement yet.
No WebApplicationContext found: no ContextLoaderListener registered? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No WebApplicationContext found: no ContextLoaderListener registered?

    Hi,

    I'm Newbie with spring Security, i'm following this tutorial
    Code:
    http://static.springsource.org/spring-security/site/tutorial.html
    Here is my application applicationContext-security.xml located in WEB-INF directory

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/security"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
                        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                        http://www.springframework.org/schema/security 
                        http://www.springframework.org/schema/security/spring-security-3.1.xsd">
    
        <http use-expressions="true">
            <intercept-url pattern="/**" access="permitAll" />
            <form-login />
        </http>
    
        <authentication-manager>
            <authentication-provider>
                <user-service>
                    <user name="patricx" password="test" authorities="supervisor, teller, user" />
                </user-service>
            </authentication-provider>
        </authentication-manager>
    </beans:beans>
    and here is my web.xml file

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
        					http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        				id="WebApp_ID" version="2.5">
     
      <display-name>Suivi Collaborateurs</display-name>
        <context-param>
    	    <param-name>contextConfigLocation</param-name>
    	    <param-value>
    	    	/WEB-INF/spring-servlet.xml
    	      /WEB-INF/applicationContext-security.xml      
    	    </param-value>
    	</context-param>
    	<filter>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
        <servlet>
          <servlet-name>spring</servlet-name>
          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
          <servlet-name>spring</servlet-name>
          <url-pattern>*.html</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.less</url-pattern>
        </servlet-mapping>
        
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.css</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.js</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.ico</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.txt</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.gif</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.jpg</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
          <servlet-name>default</servlet-name>
          <url-pattern>*.png</url-pattern>
        </servlet-mapping>
      
    	
        <welcome-file-list>
          <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
      </web-app>

    when i start my application i get this error page
    Code:
    type Rapport d''exception
    
    message No WebApplicationContext found: no ContextLoaderListener registered?
    
    description Le serveur a rencontré une erreur interne qui l''a empêché de satisfaire la requête.
    
    exception
    
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
    	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:251)
    
    note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/7.0.35.
    please what is my error and how to fix it?

    Thanks

  • #2
    See if searching for your error message helps. For example, the first result when Googling for "No WebApplicationContext found: no ContextLoaderListener registered?" I come up with results in a stackoverflow question that appears to be the correct answer

    Comment


    • #3
      Thanks

      In Fact, the problem was on my button

      it was <input type="button" /> instead of <input type="submit" />
      Thanks once more

      Comment

      Working...
      X