cvc-elt.1: Cannot find the declaration of element 'beans' cvc-elt.1: Cannot find the declaration of element 'beans' spring spring

cvc-elt.1: Cannot find the declaration of element 'beans'


Your default namespace is http://www.springframework.org/schema/security and you configured xmlns:beans="http://www.springframework.org/schema/beans"this means you have to add the prefix beans: to all the tag form http://www.springframework.org/schema/beans so your XML should be as follows.

<?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.xsd       http://www.springframework.org/schema/security       http://www.springframework.org/schema/security/spring-security-3.2.xsd       http://www.springframework.org/schema/context       http://www.springframework.org/schema/context/spring-context.xsd"       xmlns:context="http://www.springframework.org/schema/context">    <context:component-scan base-package="com.humandevice.drive.fx">        <context:include-filter type="regex"                                expression="com.humandevice.drive.fx.*" />    </context:component-scan>    <beans:bean id="LoginController" alias="loginController" class="controller.LoginController">        <beans:property name="authenticationManager" ref="authenticationManager" />        <beans:property name="applicationContext" ref="applicationContext" />    </beans:bean>    <beans:bean id="applicationContext" alias="applicationContext"          class="org.springframework.context.ApplicationContext;">    </beans:bean>    <authentication-manager alias="authenticationManager">        <authentication-provider user-service-ref="userService">            <password-encoder ref="bCryptPasswordEncoder" />        </authentication-provider>    </authentication-manager></beans:beans>


This code will help you.

<?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:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:/org/springframework/beans/factory/xml/spring-beans-3.0.xsd http://www.springframework.org/schema/context classpath:/org/springframework/context/config/spring-context-3.0.xsdhttp://www.springframework.org/schema/aop classpath:/org/springframework/aop/config/spring-aop-3.0.xsd">      </beans>


For me I just did cut and paste and save of XML files in same place and it worked for me !!