In eclipse, sometimes in an XML file, especially in a spring-related configuration file, there are compilation errors that do not affect the program's normal operation, such as:
Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.0.xsd).
You can resolve this compilation error by following these steps:
1. The spring version is changed, but the Eclipse compiler uses the previously cached spring-beans-**.xsd file. The reason is
For the Eclipse compiler, there is a cache that caches these configuration files, so the validation tells you that the version is not uniform.
The workaround is to empty the files and force eclipse to reload the files.
1) Cache, Network Connections, General, Preferences,
Select the Response file disease Click Delete or click Delete all directly.
2) If it is a MAVEN project, right-click the project and select Maven, select Update Project.
3) If the above two steps are not working, you can close project and reopen force Eclipse to compile.
2. The currently used spring version and configuration file are not the same, resulting in files such as XSD will not be loaded correctly, the current version can be changed.
If unsuccessful, repeat the above 2) 3) two steps.
3. When using spring, multiple configuration files are used, so the configuration of the head must be unified.
If unsuccessful, repeat the above 2) 3) two steps.
Eclipse XML Compilation error referenced file contains errors-spring-beans-4.0.xsd