Referenced file contains errors (http://www.springframework.org/schema/context/spring-context-3.1.xs

在网上复制了一下SpringMVC.xml文件,报了个的

Referenced file contains errors (http://www.springframework.org/schema/context/spring-context-3.1.xsd).  For more information, right click on the message in the Problems View and select "Show Details..." spring-mybatis.xml /test_mass/src/main/resources line 1 XML Problem

错误,在网上找了半天,又看了以前的项目 。最后把SpringMVC头部的

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
     http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
     version="3.0">
改成了
<?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:p="http://www.springframework.org/schema/p"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">




猜你喜欢

转载自blog.csdn.net/weixin_41963069/article/details/80751228