关于Pre-bound JDBC Connection found! HibernateTransactionManager does not 异常小结

昨天帮女朋友配置ssh框架的多数据源, 本以为对此已经很熟悉,配置完其他的错倒是还能接受,调了一下就好了。  唯独 Pre-bound JDBC Connection found! HibernateTransactionManager does not  这个异常着实浪费了我些时间。

也百度看到网上说是, 因为在代码中同时使用了jdbc和spring管理的hibernate 两种事务导致的,所以一开始重心放到了代码中,可是检查了N次代码没有问题啊, 最后实在不行找一个配置好的开始比对,试了几次才发现原来是配置事务的xml文件的头部不对,替换下面这个就好了。    原因:之前的配置少了schema/tx.xsd 和schma/tx/spring-tx.xsd和 schema/aop/spring-aop.xsd  来声明使用的事务。  这里记录一下希望可以帮到有同样异常的小伙伴。

<?xml version="1.0" encoding="UTF-8"?>
<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" xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"
>

 

转载于:https://www.cnblogs.com/qiaoyutao/p/10978438.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值