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文件最上方的引用是不是写错了。

    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码