事务配置不对导致:•Could not obtain transaction-synchronized Session for current thread
2016-03-21 17:20
591 查看
Strutshasdetectedanunhandledexception:
Messages:•Couldnotobtaintransaction-synchronizedSessionforcurrentthread
File:org/springframework/orm/hibernate5/SpringSessionContext.java
Linenumber:132
Stacktraces
org.hibernate.HibernateException:Couldnotobtaintransaction-synchronizedSessionforcurrentthread
org.springframework.orm.hibernate5.SpringSessionContext.currentSession(SpringSessionContext.java:132)
org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:687)
com.com.service.DepartmentDao.getSeesion(DepartmentDao.java:20)
com.com.service.DepartmentDao.getAll(DepartmentDao.java:26)
com.com.service.DepartmentService.getAll(DepartmentService.java:19)
com.actions.DepartmentAction.list(DepartmentAction.java:28)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:870)
ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293)
[/code]
原本目标路径是:com.com.service在
expression="execution(*com.*.*(..))"/>
[/code]就出现此错误。
把目标路径修改为:com.service后,在
expression="execution(*com.service.*.*(..))"/>
[/code]解决。
相关文章推荐
- lightoj 1038-Race to 1 Again 期望类DP
- [LeetCode][智力题]Climbing Stairs
- 说说我们的通用型人工智能
- CLAIMS 第三方安装包编译问题
- 数据挖掘十大经典算法(九) 朴素贝叶斯分类器 Naive Bayes
- FOJ-1001-Duplicate Pair
- IntelliJ IDEA 工具grails实现多个文件压缩下载
- Pair RDD基本操作
- main函数第3个参数envp装的是什么
- 217. Contains Duplicate
- inotifywait
- IntelliJ IDEA 工具grails框架打war包
- baiduAPI 免费调用天气预报
- kill()、raise()、alarm()、pause()、
- RAID级别简介
- 1.插入排序—直接插入排序(Straight Insertion Sort)
- Rails 实现多对多自连接
- Dell R420 RAID建立以及系统安装
- 使用AIDE做Linux高级入侵检测文件监控
- error LNK2019: 无法解析的外部符号 _main,该符号在函数___tmainCRTStartup 中被引用