zoukankan      html  css  js  c++  java
  • The prefix "tx" for element "tx:annotationdriven" is not bound.

    出现这个问题怎么解决 

    在 applicationContext.xml中加入如下代码

    但再加入之前,确定你已经加入了 aop支持的jar包 和 annotation jar包 我这里使用的是 spring 3.0 

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
                         http://www.springframework.org/schema/tx 
                         http://www.springframework.org/schema/tx/spring-tx.xsd 
                         http://www.springframework.org/schema/aop 
                         http://www.springframework.org/schema/aop/spring-aop.xsd">
    <tx:annotation-driven transaction-manager="txManager" />
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p"
        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-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
    <context:annotation-config />
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

    这样就完成了 事务annotation配置 !

  • 相关阅读:
    浅入ABP(1):搭建基础结构的 ABP 解决方案
    浅入ABP(2):添加基础集成服务
    GDB 调试 .NET 程序实录
    浅入 ABP 系列(6):数据库配置
    浅入 ABP 系列(4):事件总线
    浅入 ABP系列(3):增加日志组件、依赖注入服务
    模拟IIC总线多设备挂载(12864OLED屏幕+GY30光照传感器)
    RabbitMQ与Kafka选型对比
    .Net在Windows上使用Jenkins做CI/CD的那些事
    Tomcat乱码问题
  • 原文地址:https://www.cnblogs.com/dafa/p/2819005.html
Copyright © 2011-2022 走看看