spring tx:advice事务配置—— tx:advice中不允许出现属性 ‘transaction-manager‘

今天在配置java事务管理时出现了一些问题。

提示:只有这几个属性

经过查询资料发现是bean的配置少了一些。

可以在xml文件顶部添加:

复制代码
       xmlns:tx="http://www.springframework.org/schema/tx"

下面也提供一份bean文件配置的模板:

(可以直接将bean文件默认设置为如下模板)

复制代码
<?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:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
</beans>

模板参考:元素 'tx:advice' 中不允许出现属性 'transaction-manager'-CSDN博客

相关推荐
BingoGo37 分钟前
PHP clone 之后,为什么改副本会影响原对象?
后端·php
JaguarJack1 小时前
PHP clone 之后,为什么改副本会影响原对象?
后端·php·服务端
小灰灰搞电子1 小时前
Rust+Slint 实现动态消息提示框源码分享
开发语言·后端·rust
魏 无羡1 小时前
webclient
java·webclient
小奏技术2 小时前
10 MB 的 Postman 替代品,启动不到 1 秒
后端
东风破_2 小时前
Text2SQL :用自然语言操作 SQLite 数据库
人工智能·后端
神仙别闹2 小时前
基于 C++ 实现两个有序链表序列的交集
java·c++·链表
swordbob3 小时前
ReentrantLock 与 AQS 完整学习手册
java·开发语言
m0_587383004 小时前
全民健身解决方案软件开发实战:从架构设计到落地指南
java·spring boot·spring·架构·需求分析
白山编程大哥4 小时前
Java OutputStreamWriter 详解:从字符到字节的桥梁
java·开发语言·python