zoukankan      html  css  js  c++  java
  • 事务配置不对导致:•Could not obtain transaction-synchronized Session for current thread

    1. Struts has detected an unhandled exception:
    2. Messages: Could not obtain transaction-synchronized Session for current thread
    3. File: org/springframework/orm/hibernate5/SpringSessionContext.java
    4. Line number: 132
    5. Stacktraces
    6. org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
    7. org.springframework.orm.hibernate5.SpringSessionContext.currentSession(SpringSessionContext.java:132)
    8. org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:687)
    9. com.com.service.DepartmentDao.getSeesion(DepartmentDao.java:20)
    10. com.com.service.DepartmentDao.getAll(DepartmentDao.java:26)
    11. com.com.service.DepartmentService.getAll(DepartmentService.java:19)
    12. com.actions.DepartmentAction.list(DepartmentAction.java:28)
    13. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    14. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    15. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    16. java.lang.reflect.Method.invoke(Method.java:498)
    17. ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:870)
    18. ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293)

    原本目标路径是:com.com.service   在
    1. expression="execution(* com.*.*(..))"/>
    就出现此错误。

    把目标路径修改为:com.service后,在
    1. expression="execution(* com.service.*.*(..))"/>
    解决。




  • 相关阅读:
    VS使用技巧
    写的一个简单定时器(非独立线程)
    C/C++技巧
    【转载】R6034错误,C Runtime Error
    C/C++面试题(一)
    常用的coco2d-x游戏开发工具(转)
    AndroidJNI 调用JAVA(转)
    Android SDK +Eclipse+ADT+CDT+NDK 开发环境在windows 7下的搭建
    简单的字符串压缩--C代码
    SQLite: sqlite_master(转)
  • 原文地址:https://www.cnblogs.com/share2015/p/5302803.html
Copyright © 2011-2022 走看看