無法讀取方案文檔 'http://www.springframework.org/schema/cache/spring-mvc
org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 25; schema_reference.4: 無法讀取方案文檔 'http://www.springframework.org/schema/cache/spring-mvc.xsd', 原因?yàn)?1) 無法找到文檔; 2) 無法讀取文檔; 3) 文檔的根元素不是 <xsd:schema>
以上報(bào)錯(cuò):
xsd文件無法讀取,本地jar包文件獲取失敗
一般解決方法:
將https協(xié)議換為http

然后從網(wǎng)上搜了好多方法,也了解了這個(gè)底層的邏輯
具體這里不細(xì)講了
我的解決辦法是:
打開自己讀取不到方案文檔的jar包,例如我的是spring-mvc


你可以檢查下自己的版本號
我這里復(fù)制一個(gè)

然后spring-mvc.xml文件變?yōu)?/p>
<?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:mvc="http://www.springframework.org/schema/mvc"
? ? ? xmlns:context="http://www.springframework.org/schema/context"
? ? ? 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.1.xsd
? ? ? ?http://www.springframework.org/schema/context
? ? ? ?http://www.springframework.org/schema/context/spring-context.xsd">
<!--注解驅(qū)動-->
<mvc:annotation-driven/>
<!-- ? ?靜態(tài)資源過濾-->
<mvc:default-servlet-handler/>
<!-- ? ?掃描包:controller-->
<context:component-scan base-package="com.monan.controller"/>
<!-- ? ?視圖解析解-->
<!-- ? ?這里面有兩個(gè)屬性前綴后綴-->
? ?<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
? ? ? ?<property name="prefix" value="/WEB-INF/jsp/"/>
? ? ? ?<property name="suffix" value=".jsp"/>
? ?</bean>
</beans>
然后這個(gè)不在報(bào)錯(cuò)