找不到当前线程的会话(Spring 3.1.X和Hibernate 4)

找不到当前线程的会话(Spring 3.1.X和Hibernate 4),第1张

找不到当前线程的会话(Spring 3.1.X和Hibernate 4)

我在spring-4.0.6和hibernate-4.3.6中遇到了这个问题。

解决方案是将所有注释驱动,组件扫描,注释驱动的指令从root-context.xml移至servlet-context.xml:

<mvc:annotation-driven /><context:component-scan base-package="ru.dd.demo" /><tx:annotation-driven transaction-manager="transactionManager" />

仍然可以在root-context.xml中定义dataSource,sessionFactory和transactionManager。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5019662.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-15
下一篇2022-11-15

发表评论

登录后才能评论

评论列表(0条)

    保存