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管理了,事务也生效了