The transaction is not configured to cause:? Could not obtain transaction-synchronized Session for current thread

Source: Internet
Author: User

  
 
  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)

The original target path is: Com.com.service in
 
   
  
  1. expression="execution(* com.*.*(..))"/>
This error occurs.
Modify the target path to: Com.service after the
 
   
  
  1. expression="execution(* com.service.*.*(..))"/>
Solve.

From for notes (Wiz)

The transaction is not configured to cause:? Could not obtain transaction-synchronized Session for current thread

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.