应用程序上下文中 Spring Beans 模式的验证错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7267341/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Validation Error of Spring Beans Schema inside Application Context
提问by devpg
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.
设置新的基于 Spring 的应用程序后,我在应用程序上下文中遇到了引用模式 (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd) 的问题。
appContext.xml
应用上下文.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!
即使我将配置减少到最低版本(没有任何 bean 定义),我也会收到此错误。有人知道这里有什么问题吗?提前致谢!
Btw: I'm using STS 2.7.1
顺便说一句:我正在使用 STS 2.7.1
回答by Tristan
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...).
也许您有一个不再存在的错误,但错误消息是从缓存中显示的。出现此错误可能是因为 applicationContext.xml 中混合了 2.5 xsd 和 3.0 xsd。您应该能够通过右键单击它来获取有关此错误的详细信息(尽管不是特别明确的详细信息...)。
Try to clean the error message and re-validate with this minimal file anyway.
无论如何,尝试清除错误消息并使用此最小文件重新验证。
回答by Hubert E
In MyEclipseBlue, go to Preferences->My Eclipse->Internet Tools->Cache and remove the files
在 MyEclipseBlue 中,转到 Preferences->My Eclipse->Internet Tools->Cache 并删除文件
回答by Nathan Adams
In Eclipse/STS go to Preferences -> General -> Network Connections and remove the offending files.
在 Eclipse/STS 中,转到 Preferences -> General -> Network Connections 并删除有问题的文件。
回答by Matija Samac
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
复制标签内的所有内容然后删除除第一行之外的所有内容并保存文件。粘贴您复制的内容并重新保存(确保您的互联网连接正常工作以确保安全)。再次保存文件

