Cannot find the declaration of element 'beans' in internet offline mode Cannot find the declaration of element 'beans' in internet offline mode xml xml

Cannot find the declaration of element 'beans' in internet offline mode


If you're using Spring 3.0.5, then you should be using the 3.0 schema, not the 3.1 schema. Spring validates your XML files against copies of the schema that it holds within its own JAR files, rather than copies it fetches from the internet.


Removing the specific version numbers should solve your problem.

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

Inside the spring jars there is a spring.schemas file that is used to map Spring Schema URIs to local copies packaged in the spring jars. Below is an example of a spring.schemas file that was taken from the spring-beans jar (version 3.0.7.RELEASE). As you can see "spring-beans.xsd" is mapped to "spring-beans-3.0.xsd", which is the version of the jar.

This approach will assure that you are always using the correct schema version; upgrading your spring jars will automatically update your schemas.

http\://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsdhttp\://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsdhttp\://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsdhttp\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsdhttp\://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsdhttp\://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsdhttp\://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsdhttp\://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsdhttp\://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsdhttp\://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsdhttp\://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsdhttp\://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd


If you have Spring 3.0 then your schema declaration should be as follows (note version changed to 3.0):

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