3
votes

in the below code i am getting a error like this "cvc-complex-type.2.4.a: Invalid content was found starting with element 'global-method-security'. One 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}' is expected."

how to fixed it ?

 <?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:context="http://www.springframework.org/schema/context"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">



<context:component-scan base-package="client.security"/>

<global-method-security secured-annotations="enabled" />


</beans>
1
Your root namespace is beans not security. Prefix it with security: - M. Deinum

1 Answers

6
votes

Replace the

"<global-method-security secured-annotations="enabled" />" line with 

     <security:global-method-security secured-annotations="enabled"/>

it should work ..