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博客

相关推荐
拔剑纵狂歌13 分钟前
ClickHouse system.query_log 字段详解与排障实践
后端·clickhouse·1024程序员节
_upupup15 分钟前
异常(C++)
java·开发语言·jvm
g105655913918 分钟前
公有云_云运维服务
java·运维·服务器
再吃一根胡萝卜24 分钟前
把本地 RAG 问答做"准":多轮指代消解 + 云端语义向量 + TXT 章节切分
后端
霸道流氓气质29 分钟前
ComfyUI 图像生成工作流完全指南:从节点编排到Java生产级图像生产实战
java·开发语言·人工智能
再写一行代码就下班40 分钟前
linux sh脚本在windows修改导致无法使用解决方式
java·linux·centos
怕浪猫1 小时前
2026年9月面18个后端
后端·面试·github
IT_陈寒1 小时前
Vue 这个响应式陷阱,我的头发都掉没了
前端·人工智能·后端
谁在黄金彼岸1 小时前
trae的gitee mcp莫名错误
后端
前端的日常1 小时前
一个人+AI做情侣食谱小程序,30天纯赚
前端·javascript·后端