spring配置事务 元素 "tx:annotation-driven" 的前缀 "tx" 未绑定
在进行spring与mybatis整合时,启动项目报错,控制台提示“元素 "tx:annotation-driven" 的前缀 "tx" 未绑定”。
经过查找,是因为没有在该配置文件中定义tx开头的命名空间。
配置文件spring-mybatis.xml中需要添加以下红色字体部分:
<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"
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.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
上面的问题便可以解决。
同理,如果报出 “元素 'aop' 未绑定,前缀 'tx' 未绑定,前缀 'mvc' 未绑定”等,也可用以上方法解决。
版权声明:本文为博主原创文章,未经博主允许不得转载。 http://blog.csdn.net/FrenandoChiang/article/details/54864441- spring配置事务 元素 "tx:annotation-driven" 的前缀 "tx" 未绑定
- 元素 "tx:annotation-driven" 的前缀 "tx" 未绑定
- Spring配置文件:元素 "context:component-scan" 的前缀 "context" 未绑定。
- spring配置出现前缀 "tx" 未绑定、前缀 "mvc" 未绑定等情况
- 元素 tx:annotation-driven 的前缀 tx未绑定
- 关于spring配置中the prefix "tx" for element "tx:annotation-driven" is not bound 问题的处理
- Spring_元素 "context:annotation-config" 的前缀 "context" 未绑定
- Spring配置问题——元素 "context:component-scan" 的前缀 "context" 未绑定
- SpringMVC项目中配置xml时一些和命名空间相关的问题,如mvc:annotation-driven的前缀 "mvc"未绑定
- Spring配置问题——元素 "context:component-scan" 的前缀 "context" 未绑定
- Spring 配置文件报错:元素 "context:component-scan" 的前缀 "context" 未绑定。
- 关于Spring事务<tx:annotation-driven/>的理解(Controller可以使用@Transactional)
- 关于Spring事务<tx:annotation-driven/>的理解(Controller可以使用@Transactional)
- Spring的annotation-driven配置事务管理器详解
- spring的annotation-driven配置事务管理器详解
- 关于Spring事务<tx:annotation-driven/>的理解(Controller可以使用@Transactional)
- spring的annotation-driven配置事务管理器详解
- [转]Spring事务<tx:annotation-driven/>
- spring的annotation-driven配置事务管理器详解
- spring的annotation-driven配置事务管理器详解