zc_vip 2017-10-27 12:00 采纳率: 0%
浏览 2029

SpringMVC注解驱动报错

用myeclipse2016写代码,使用注解开发时,xml文件有错误
代码如下

 <?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:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        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/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <!-- 注解驱动包含了注解的处理器映射器和处理器适配器的配置 -->
    <mvc:annotation-driven></mvc:annotation-driven>
    <!-- 组件扫描会扫描指定包路径下的含有controller注解的类 -->
    <context:component-scan base-package="controller"></context:component-scan>
    <!-- 处理器视图解析器 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"></bean>
</beans>

错误如下:
图片说明

第19行错误

 Multiple annotations found at this line:
    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:annotation-driven'.
    - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/mvc/spring-mvc.xsd', because 1) could not 
     find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

附jar包图
图片说明
求大家指点一下,错误在什么地方

  • 写回答

2条回答

  • 软件求生 2017-11-07 09:02
    关注

    检查一下xml文件最上方的引用是不是写错了。

    评论

报告相同问题?

悬赏问题

  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)