BkSouX
BkSouX

Reputation: 779

Spring Security XML can't find tag with error cvc-complex-type.2.4.c

I have a problem with Spring Security. Eclipse can't find the html tag in the spring-security.xml with this error :

Caused by: org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 28; cvc-complex-type.2.4.c : 
The matching wildcard is strict, but no declaration can be found for element 'http'

here is the xml

<?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.1.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-3.1.xsd
">

  <http auto-config='true'>
    <intercept-url pattern="/**" access="ROLE_USER"/>
  </http>

  <authentication-manager>
    <authentication-provider>
      <user-service>
        <user name="user1" password="1111" authorities="ROLE_USER"/>
      </user-service>
    </authentication-provider>
  </authentication-manager>

</beans:beans>

The problem is with the first tag, html, but I can't find any issue with the xsd configuration.

Any ideas ?

Thank you very much.

Upvotes: 1

Views: 2006

Answers (1)

Vincent
Vincent

Reputation: 1035

You may be missing the spring-security-config dependency where all XSD files are found.

Be sure to declare this one if it's not in your classpath:

<dependency>
  <groupId>org.springframework.security</groupId>
  <artifactId>spring-security-config</artifactId>
  <version>${spring-security.version}</version>
</dependency>

Upvotes: 2

Related Questions