springMVC + mybatis 下出现JDBC Connection *** will not be managed by Spring错误


仔细查看配置中是否有如下类似的配置 execution(* com.ciguo.service.*.*(..))

<aop:config>
<aop:pointcut id="operation" expression="execution(* com.sword.dataprocess.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="operation" />
<aop:advisor advice-ref="txAdvice"
pointcut="execution(* com.sword.dataprocess.service*.*.*(..))" />
</aop:config>

这种写法是扫描到service下一级*.java里面的方法,显然是找不到的,于是乎改成 execution(* com.ciguo.service.impl.*.*(..))

<aop:config>
<aop:pointcut id="operation" expression="execution(* com.sword.dataprocess.service.impl.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="operation" />
<aop:advisor advice-ref="txAdvice"
pointcut="execution(* com.sword.dataprocess.service.impl*.*.*(..))" />
</aop:config>

SqlSession现在已经被spring管理了,事务也生效了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM