其實是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"/>