Spring配置文件报Referenced file contains errors :beans/factory/xml/spring-beans-4.3.xsd

来源:互联网 发布:济宁网络问政平台登录 编辑:程序博客网 时间:2024/03/29 07:11

网上参考了一些别人的方法,这个问题一般是版本问题导致的,首先确认你的版本是否一致(如果你的电脑上只有一个版本的spring,直接跳过这一步)。

然后呢,你看一下自己的配置文件,

<?xml version="1.0" encoding="UTF-8"?><beans    xmlns="http://www.springframework.org/schema/beans"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns:context="http://www.springframework.org/schema/context"    xmlns:mvc="http://www.springframework.org/schema/mvc"    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">        <!-- 配置自动扫描 -->    <context:component-scan base-package="cn.fxd"></context:component-scan>         <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">        <property name="prefix" value="/WEB-INF/views"></property>        <property name="suffix" value=".jsp"></property>     </bean></beans>
注意这一行:http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd,看看是不是是4.0.xsd。入过不是,就会报错。也就说,这里的版本要一致。




0 0
原创粉丝点击