zoukankan      html  css  js  c++  java
  • SpringMVC版本报错解决办法

    报错代码:

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <beans xmlns="http://www.springframework.org/schema/beans"
     3 xmlns:context="http://www.springframework.org/schema/context"
     4     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     5     xsi:schemaLocation="
     6         http://www.springframework.org/schema/beans
     7         http://www.springframework.org/schema/beans/spring-beans.xsd
     8         http://www.springframework.org/schema/context
     9         http://www.springframework.org/schema/context/spring-context.xsd">
    10   <context:component-scan base-package="cn.aynu.spring.controller"/>
    11    
    12     </beans>

    提示错误:

    The errors below were detected when validating the file "spring-beans-4.3.xsd" via the file "springmvc-config.xml".  In most cases these errors can be detected by validating "spring-beans-4.3.xsd" directly.  However it is possible that errors will only occur when spring-beans-4.3.xsd is validated in the context of springmvc-config.xml.译文:在验证文件“spring-beans-4.3”时检测到以下错误。通过文件“springmvc-config.xml”创建xsd。在大多数情况下,可以通过验证“spring-beans-4.3”来检测这些错误。xsd直接”。然而,也有可能只有在spring-beans-4.3时才会发生错误。xsd在springmvc-config.xml上下文中进行了验证。

    解决方案:增加spring-beans.xsd版本号,此项目用的是spring4.3.6,修改后代码如下:

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <beans xmlns="http://www.springframework.org/schema/beans"
     3 xmlns:context="http://www.springframework.org/schema/context"
     4     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     5     xsi:schemaLocation="
     6         http://www.springframework.org/schema/beans
     7         http://www.springframework.org/schema/beans/spring-beans-4.3-6.xsd
     8         http://www.springframework.org/schema/context
     9         http://www.springframework.org/schema/context/spring-context-4.3-6.xsd">
    10   <context:component-scan base-package="cn.aynu.spring.controller"/>
    11    
    12     </beans>

    总结:此类报错为xsd版本问题,若代码本身有版本号报错,可尝试删除版本号,或更改版本号

  • 相关阅读:
    面试题 31: 求子数组的最大和
    [面试] 结构体占用空间的问题,内存对齐~! 真的懂了,cpu取加快速度,省空间来考虑。
    [计算机] 32768~32767 计算机中的 1 表示
    C#跨线程调用窗体控件
    合并字节数组
    将汉字转化为2位大写的16进制Unicode
    关公与子龙两大杀手
    早年的J2EE笔记
    给小组新成员的一份信
    c++虚函数详解
  • 原文地址:https://www.cnblogs.com/axibug/p/12374121.html
Copyright © 2011-2022 走看看