java - Spring security issue with Http tag -


my spring configuration file follows

<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"      xmlns:p="http://www.springframework.org/schema/p"     xmlns:context="http://www.springframework.org/schema/context"     xmlns:mvc="http://www.springframework.org/schema/mvc"      xmlns:jpa="http://www.springframework.org/schema/data/jpa"     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/mvc      http://www.springframework.org/schema/mvc/spring-mvc.xsd     http://www.springframework.org/schema/context      http://www.springframework.org/schema/context/spring-context.xsd     http://www.springframework.org/schema/data/jpa     http://www.springframework.org/schema/data/jpa/spring-jpa.xsd     http://www.springframework.org/schema/security     http://www.springframework.org/schema/security/spring-security.xsd     ">  <http auto-config="true">         <security:intercept-url pattern="/admin**" access="role_user" />     </http>      <authentication-manager>       <authentication-provider>         <user-service>         <user name="test" password="test" authorities="role_user" />         </user-service>       </authentication-provider>     </authentication-manager>  </beans> 

however have encountered following error

cvc-complex-type.2.4.a: invalid content found starting element 'http'. 1 of '{"http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://  www.springframework.org/schema/beans":bean, wc[##other:"http://www.springframework.org/schema/beans"], "http://www.springframework.org/schema/beans":beans}' expected. 

what possibly wrong? error cross mark shown eclipse right http tag starts.

update using gradle , build.gradle file has following dependencies spring:

 compile 'org.slf4j:slf4j-api:1.7.12'     compile 'com.googlecode.json-simple:json-simple:1.1.1'     compile 'de.grundid.opendatalab:geojson-jackson:1.0'     compile 'org.springframework:spring-web:4.2.5.release'     compile 'org.springframework:spring-webmvc:4.2.5.release'     compile 'org.springframework:spring-jdbc:4.2.5.release'     compile 'org.springframework:spring-core:4.2.5.release'     compile 'org.springframework:spring-context:4.2.5.release'     compile 'org.springframework:spring-aop:4.2.5.release'     compile 'org.springframework.security:spring-security-web:4+'     compile 'org.springframework.security:spring-security-config:4+' 

the following spring dependencies in project's build path: enter image description here

your xml document has spring beans namespace default namespace. http element , other elements spring security in security namespace. need prefix:

<security:http auto-config="true">   <security:intercept-url pattern="/admin**" access="role_user" /> </security:http>  <security:authentication-manager>   <security:authentication-provider>     <security:user-service>       <security:user name="test" password="test" authorities="role_user" />     </security:user-service>   </security:authentication-provider> </security:authentication-manager> 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -