The prefix "tx" for element "tx:advice" is not bound
这个错误的原因很简单是:
我们在定义申明AOP的时候。。没有加载schema。
具体表现如下:
<beans>
<tx:advice transaction-manager="transactionManager">
<tx:attributes>
<tx:method read-only="true"/>
<tx:method propagation="REQUIRES_NEW" rollback-for="Exception"/>
</tx:attributes>
</tx:advice>
<!-- aop代理设置-->
<aop:config proxy-target-class="true">
....
</aop:config>
</beans>
这时会抛出异常不认<TX>标签。。起先还以为是没有加载JAR包呢。。
后来读AOP文档才发现<beans>中要加入“xmlns:aop”的命名申明,并在“xsi:schemaLocation”中指定aop配置的schema的地址
配置文件如下:
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="">
这些才是最关键的地方。。后面的配置不变。。。。
from:http://blog.163.com/wex660@126/blog/static/2415306520089785253813/
分享到:
相关推荐
在这个问题中,开发者遇到了一个常见的错误:“Name jdbc is not bound in this Context”,这通常意味着在Tomcat的环境中,指定的数据源没有被正确地绑定或配置。 要解决这个问题,首先需要在Tomcat的配置文件中...
Name salesDataSource is not bound in this Context,连接池的问题
然而,在使用 Hibernate 进行数据库操作时,经常会遇到 "No Hibernate Session bound to thread" 的错误信息。本文将详细介绍该错误的解决方案。 错误原因 "No Hibernate Session bound to thread" 错误信息通常是...
然而,当遇到"Invalid parameter number: no parameters were bound"错误时,这意味着尝试执行的SQL语句中的占位符参数没有正确地与实际值绑定。 这个问题在某些旧版本的PHP和PDO中被报告为一个bug,特别是...
【整数规划与分支定界法】 在数学优化领域,整数规划是线性规划的一个扩展,其中变量被要求取整数值,而不仅仅是在实数域内。这使得问题复杂度显著增加,因为整数解可能不在连续的可行域内。分支定界法是一种解决...
在这篇文章中,将详细介绍“Competitive Programming 3 The New Lower Bound of Programming Contests”一书中的主要内容,围绕算法竞赛的入门技巧、数据结构与算法范式、图论等知识点。 在算法竞赛中,“Tip 1: ...
错误四:The prefix "context" for element "context:component-scan" is not bound. 错误原因:在 beans 标签中少写了一 个 xmlns:context="http://www.springframework.org/schema/context" 解决方式:加上缺少...
在使用MyBatisPlus进行开发时,可能会遇到一个常见的错误——`Invalid bound statement (not found)`。这个错误通常表示MyBatisPlus无法找到你尝试调用的Mapper接口的方法。本文将详细解析这个问题的原因以及提供...
std::cout << "The first element in the vector that is not less than " << search_value << " is " *it << std::endl; } return 0; } ``` #### 四、分析与解释 1. **创建已排序的序列**:首先创建了一个已...
std::cout << "The first element greater than or equal to " << value_to_find << " is " *it << std::endl; } else { std::cout << "No element found greater than or equal to " << value_to_find << std::...
Written by Canon Explorer of Light Rick Sammon and leading fashion and studio photographer Vered Koshlano, this guide is packed with professional advice on the essential element of photography: ...
Written by Canon Explorer of Light Rick Sammon and leading fashion and studio photographer Vered Koshlano, this guide is packed with professional advice on the essential element of photography: ...
std::cout << "The first element greater than or equal to " << value << " is " *it << std::endl; } else { std::cout << "No element found greater than or equal to " << value << std::endl; } ...
集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...
在使用MyBatis框架进行开发时,可能会遇到一个常见的错误:`BindingException: Invalid bound statement (not found)`。这个错误通常意味着MyBatis无法找到你在Mapper接口中声明的方法与XML映射文件中对应的SQL语句...
std::cout << "The first element greater than or equal to " << target << " is " *it << std::endl; } else { std::cout << "No element found greater than or equal to " << target << std::endl; } ...
### Lower_bound 函数详解 #### 一、Lower_bound 概述 `lower_bound`是C++标准库中的一个算法函数,通常被用于在一个有序区间内查找特定元素的第一个位置。此函数在`<algorithm>`头文件中定义。它返回的是一个指向...