title: Spring Security : configuration error
body: <p>I am not able to solve this problem that I have XSD version above 4 then why there is still conflict?</p>
  
  <p>I am using Spring JARs and all of them  have version 4 or above and still getting error. </p>
  
  <p>Following is XSD for <code>spring-security.xml</code>: </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.1.xsd"&gt;
      &lt;security:http auto-config="true"&gt;  &lt;!-- ////this line holds error/////--&gt;
          &lt;security:intercept-url pattern="/"
              access="hasRole('ROLE_ADMIN')" /&gt;
          &lt;security:form-login login-page="/login"
              default-target-url="/" authentication-failure-url="/loginerror" /&gt;
          &lt;security:logout logout-success-url="/logout" /&gt;
          &lt;security:csrf disabled="true" /&gt;
      &lt;/security:http&gt;
      &lt;security:authentication-manager&gt;
          &lt;security:authentication-provider&gt;
              &lt;security:user-service&gt;
                  &lt;security:user name="admin" authorities="ROLE_ADMIN"
                      password="admin" /&gt;
              &lt;/security:user-service&gt;
          &lt;/security:authentication-provider&gt;
      &lt;/security:authentication-manager&gt;
  &lt;/beans&gt; 
  </code></pre>
  
  <p>and following is the error: </p>
  
  <blockquote>
    <p>Multiple annotations found at this line:
      - Configuration problem: You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd schema with Spring Security 3.1. Please update
    your schema declarations to the 3.1 schema. Offending resource: file
    [C:/Documents and      Settings/Administrator/My Documents/Google
    Drive/spring_workspace/spring
    security_demo/WebContent/WEB-INF/security-context.xml]
      - You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd schema with Spring Security 3.1. Please update your schema
    declarations to the 3.1 schema.</p>
  </blockquote>
  
  <p><strong>and this is my schema for dispatcher servlet:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd"&gt;
  </code></pre>
  
  <p>First I thought I have conflicts in my both mentioned <code>.xsd</code> files but now both ' .xsd' files have same schema. </p>
  
  <p><strong>Edit: Event details</strong></p>
  
  <blockquote>
    <p>org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
    Configuration problem: You cannot use a spring-security-2.0.xsd or
    spring-security-3.0.xsd schema with Spring Security 3.1. Please update
    your schema declarations to the 3.1 schema. Offending resource: file
    [C:/Documents and Settings/Administrator/My Documents/Google
    Drive/spring_workspace/spring
    security_demo/WebContent/WEB-INF/security-context.xml]</p>
    
    <p>at
    org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$BeansConfigProblemReporter.fatal(BeansConfig.java:1137)</p>
    
    <p>at
    org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68)</p>
    
    <p>at
    org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:55)</p>
    
    <p>at
    org.springframework.security.config.SecurityNamespaceHandler.parse(SecurityNamespaceHandler.java:66)</p>
    
    <p>at
    org.springframework.ide.eclipse.beans.core.internal.model.namespaces.DelegatingNamespaceHandlerResolver$ElementTrackingNamespaceHandler.parse(DelegatingNamespaceHandlerResolver.java:177)</p>
    
    <p>at
    org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1411)</p>
    
    <p>at
    org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ErrorSuppressingBeanDefinitionParserDelegate.parseCustomElement(BeansConfig.java:1428)</p>
    
    <p>at
    org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401)</p>
    
    <p>at
    org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:172)</p>
    
    <p>at
    org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ToolingFriendlyBeanDefinitionDocumentReader.doRegisterBeanDefinitions(BeansConfig.java:1357)</p>
    
    <p>at
    org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)</p>
    
    <p>at
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)</p>
    
    <p>at
    org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.registerBeanDefinitions(BeansConfig.java:410)</p>
  </blockquote>
  
  <p>How to solve that?</p>