zoukankan      html  css  js  c++  java
  • 通配符的匹配很全面, 但无法找到元素 'tx:annotation-driven' 的声明

    启动Tomcat时报错,通配符的匹配很全面, 但无法找到元素 'tx:annotation-driven' 的声明,报错如下

    1.从报错可以看到找不到元素   tx:annotation-driven 说明可能spring-tx-x.x.xsd结构定义的文件引用的优点问题,原本的application-spring.xml配置文件如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-4.3.xsd
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd">
    

      

     修改之后的配置文件如下:

    <?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: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/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">
    

    问题便解决了,大家可以尝试一下。

    参考链接

    https://www.cnblogs.com/Chestnuts/p/7510524.html

    https://bbs.csdn.net/topics/392162821  

  • 相关阅读:
    Linq-单条数据删除
    斐波那契额数列及青蛙跳台阶问题
    旋转数组的最小数字
    扑克牌的顺子
    qsort(),sort()排序函数
    从尾到头打印链表
    查找链表中倒数第k个结点
    左旋转字符串
    数组前半部分和后半部分有序的全排序
    二元树中和为某一值的所有路径
  • 原文地址:https://www.cnblogs.com/alice-cj/p/10423001.html
Copyright © 2011-2022 走看看