spring配置文件报警告[No grammar constraints (DTD or XML Schema) referenced in the document.]

其实是ide的xml validater未找到配置文件中引用xsd文件,可以设置忽略验证,也可以选择进行验证:一可是单独去下载这些xsd文件,二可直接用spring的jar包中的xsd文件。

 

要使用jar中的xsd文件需要这样:jar:file:/F:/apache/maven-repo/org/springframework/spring-beans/4.3.0.RELEASE/spring-beans-4.3.0.RELEASE.jar!/org/springframework/beans/factory/xml/spring-beans-4.3.xsd

当然,也可以直接在ide的配置文件里更改,我用的eclipse是在工作空间下的.metadata\.plugins\org.eclipse.wst.xml.core\user_catalog.xml 中添加:

<system systemId="http://www.springframework.org/schema/beans/spring-beans-4.3.xsd" uri="jar:file:/F:/apache/maven-repo/org/springframework/spring-beans/4.3.0.RELEASE/spring-beans-4.3.0.RELEASE.jar!/org/springframework/beans/factory/xml/spring-beans-4.3.xsd"/>

 

posted @ 2017-03-02 01:22  we212320  阅读(3519)  评论(0编辑  收藏  举报