Validation Error of Spring Beans Schema inside Application Context
Asked Answered
V

4

6

after setting up a new Spring-based application, I'm running into trouble with a referenced schema (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd) inside the application context.

appContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans 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-3.0.xsd">

 ....

</beans:beans>

Error

Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd).

Even if I reduce the configuration to the minimum version (without any bean definition), I get this error. Does anybody has a hint what's wrong here? Thanks in advance!

Btw: I'm using STS 2.7.1

Vintner answered 1/9, 2011 at 7:42 Comment(0)
S
18

Maybe you had an error which is no more there, but the error message is displayed from a cache. This error may have appeared because you had a mix of 2.5 xsd and 3.0 xsd in your applicationContext.xml. You should be able to get details about this error by right-clicking on it (not especially explicit details though...).

Try to clean the error message and re-validate with this minimal file anyway.

Spleen answered 1/9, 2011 at 7:53 Comment(2)
I've solved the problem in the meantime. It was caused by some cached files. After removing those items (Preferences -> General -> Network Connections -> Cache) everything worked as expected. Thanks!Vintner
I had faced the exact same problem. For spring beans I was using springframework.org/schema/beans/spring-beans-2.0.xsd and for AOP it was springframework.org/schema/aop/spring-aop-3.0.xsd. I just changed the aop xsd version to 2.0 (same as beans) and the issue is resolved.Jeanniejeannine
A
7

In MyEclipseBlue, go to Preferences->My Eclipse->Internet Tools->Cache and remove the files

Anglesite answered 4/3, 2015 at 15:41 Comment(3)
This worked for me. Then I had to right click on the xml file and select "validate"Severini
Perfect, I tried hundreds of way and this one worked! My error was for spring-context.xsd schema_reference.4: failed to read schema document(....Gruver
thanks man, I removed all files in the cache and then cleaned all projects ;)Scientist
F
3

In Eclipse/STS go to Preferences -> General -> Network Connections and remove the offending files.

Ferromanganese answered 9/3, 2013 at 22:14 Comment(0)
S
1

Copy everything inside tag Then delete everything except the first line and save the file. Paste what you copied and resave (be sure you have internet connection working just to be safe). Save the file again

Suffocate answered 18/9, 2019 at 9:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.