您的位置:首页 > 大数据 > 人工智能

事务配置不对导致:•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]解决。

来自为知笔记(Wiz)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: