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配置 !

  • 相关阅读:
    vaddin使用技巧
    数据库连接&数据库进程&数据库操作
    gcc编译器参数使用及解决
    smtp服务器搭建(实现本地通讯)
    jdk+tomcat+mysql搭建网站无法打开
    ie8此加载项无法恢复&网站还原错误问题解决=lr成功打开ie成功录制脚
    loadrunner打不开ie&ie默认浏览器设置方法
    判断iis是否已经安装
    loadrunner常见问题
    代码中字符串比较长时可以分行写
  • 原文地址:https://www.cnblogs.com/dafa/p/2819005.html
Copyright © 2011-2022 走看看