Error message with spring "Cannot find declaration of element 'beans'."

I am trying to configure a simple spring application and I am getting the following exception.

Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 8 in XML document from class path resource [NewFile.xml] is invalid; nested e
xception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.

I do not find my problem. this is my NewFile.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mail="http://www.springframework.org/schema/integration/mail"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/integration/mail
http://www.springframework.org/schema/integration/mail/spring-integration-mail-1.0.xsd" >

I am using spring Integration 1.0.4, spring core 2.5.6 and javamail 1.4

Regards

+4
source share
1 answer

There are two “schemes” along the way:

<beans xmlns="http://www.springframework.org/schema/schema/beans"

IIRC requires only one:

<beans xmlns="http://www.springframework.org/schema/beans"
+3
source

All Articles