通配符的匹配很全面, 但无法找到元素 'mvc:annotation-driven' 的声明

原文链接: https://my.oschina.net/u/1377774/blog/683649

“mvc:annotation-driven”可以换成任何xml标签,

 

发生错误时的配置如下:

       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/beans
        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd  ">

这个错误的根本原因在于,spring容器启动时,XmlBeanDefinitionReader类既无法通过spring的jar包的META-INFO/spring.schemas文件的映射到jar包中的相应的的xsd文件,又无法通过联网直接从http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd地址读取到相应的xsd文件。

转载于:https://my.oschina.net/u/1377774/blog/683649

你可能感兴趣的:(通配符的匹配很全面, 但无法找到元素 'mvc:annotation-driven' 的声明)