The prefix "tx" for element "tx:advice" is not bound 错误的说明
来源:互联网 发布:西安培训班软件 编辑:程序博客网 时间:2024/05/22 00:21
The prefix "tx" for element "tx:advice" is not bound 错误的说明
这个错误的原因:
抛出异常不认<TX>标签。。起先还以为是没有加载JAR包呢。。
后来读AOP文档才发现<beans>中要加入“xmlns:aop”的命名申明,并在“xsi:schemaLocation”中指定aop配置的schema的地址
1.没有加载jar包
2.Spring的配置文件
<?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:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
3.多提一下配置aop
<!-- 事务 aop 配置 -->
<aop:config>
<aop:pointcut id="serviceMethods" expression="execution(* com.cn.hnust.service.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethods"/>
</aop:config>
解释一下(* com.cn.hnust.service.*.*(..))中几个通配符的含义:
第一个 * —— 通配 任意返回值类型
第二个 * —— 通配 包com.cn.hnust.service下的任意class
第三个 * —— 通配 包com.cn.hnust.service下的任意class的任意方法
第四个 .. —— 通配 方法可以有0个或多个参数
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "tx" for element "tx:advice" is not bound.
- The prefix "tx" for element "tx:advice" is not bound
- The prefix "tx" for element "tx:annotation-driven " is not bound The prefix "tx" for element "tx:ann
- the prefix "tx" for element "tx:annotation-driven" is not bound
- 关于spring配置中the prefix "tx" for element "tx:annotation-driven" is not bound 问题的处理
- The prefix "tx" for element "tx:annotation-driven" is not bound. ssm配置事物切面报错
- Spring框架应用时,报"tx:advice" is not bound的错误
- aop advisor说明以及The prefix "aop" for element "aop:config" is not bound.错误原因
- 错误提示:The prefix "aop" for element "aop:config" is not bound.
- 错误提示:The prefix "aop" for element "aop:config" is not bound. .
- java错误-The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.
- 错误提示:The prefix "aop" for element "aop:config" is not bound. .
- springboot Jar包 秒部署到Linux服务器运行
- 浅谈贝叶斯定理
- 第十届全国大学生信息安全竞赛-线上赛 write up(持续更新)
- 2017 ACM/ICPC Asia Regional Qingdao Online:1001 Apple
- MacOS 开发
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- 菜单编辑器
- 王爽 《汇编语言》 读书笔记 十五 外中断
- MySQL的DENSE_RANK有关的一道SQL需求
- java易错题(3)
- 高可用服务设计概述[2]
- sizeof
- camera_info_manager软件包的安装方法
- 浅谈Windows接口中的一些函数命名