error:Could not obtain transaction-synchronized Session for current thread

我遇到这个问题是因为我跨过service直接调用dao层导致,一般事务在service层,所以没有使用事务

增加事务

 

2020.12.22 10:22:13.670 [ERROR]57e94726-6937-4b78-b553-f84da463df86@qtp832337886-244 c.e.f.m.w.a.GenericAction []:Exception happened
com.ebao.foundation.module.web.action.SysException: Unknown system error. Nested Exception is:org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
	at com.ebao.pub.framework.GenericActionProxy.process(GenericActionProxy.java:46) ~[iCP_iFoundation_Foundation_V3_Proxy-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.action.GenericNoTransAction._execute(GenericNoTransAction.java:159) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.action.GenericCfgTransAction._execute(GenericCfgTransAction.java:63) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.action.GenericCfgTransAction$1.doInTransaction(GenericCfgTransAction.java:44) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.action.GenericCfgTransAction$1.doInTransaction(GenericCfgTransAction.java:40) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at com.ebao.foundation.module.web.action.GenericCfgTransAction.execute(GenericCfgTransAction.java:40) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.pub.framework.GenericAction.execute(GenericAction.java:51) [iCP_iFoundation_Foundation_V3_Proxy-LS4.2.13.jar:?]
	at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110) [spring-struts-2.0.8-nodep.jar:2.0.8]
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) [struts-1.1.jar:1.1]
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) [struts-1.1.jar:1.1]
	at com.ebao.foundation.module.web.struts.BaseActionServlet.process(BaseActionServlet.java:1352) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.struts.BaseActionServlet.doPost(BaseActionServlet.java:488) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [javax.servlet-2.5.0.v201103041518.jar:?]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) [javax.servlet-2.5.0.v201103041518.jar:?]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1317) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at com.ebao.foundation.module.security.filters.S2SAuthenticationFilter.executeFilter(S2SAuthenticationFilter.java:34) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at com.ebao.foundation.module.web.filter.XssFilter.executeFilter(XssFilter.java:123) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at com.ebao.foundation.module.security.filters.PermissionFilter.executeFilter(PermissionFilter.java:141) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.2.7.RELEASE.jar:3.2.7.RELEASE]
	at com.ebao.foundation.module.security.filters.EBaoInternalLoginFilter.executeFilter(EBaoInternalLoginFilter.java:178) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.7.RELEASE.jar:3.2.7.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.7.RELEASE.jar:3.2.7.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.7.RELEASE.jar:3.2.7.RELEASE]
	at com.ebao.foundation.module.security.filters.EBaoFilterChainProxy.doFilter(EBaoFilterChainProxy.java:75) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.FilterToBeanProxy.executeFilter(FilterToBeanProxy.java:34) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at com.ebao.foundation.module.web.filter.ThreadBindResourceCleanFilter.executeFilter(ThreadBindResourceCleanFilter.java:67) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at com.ebao.ls.pub.log.LogContextFilter._doFilter(LogContextFilter.java:61) [lspub-common-4.0.96-SNAPSHOT.jar:?]
	at com.ebao.ls.pub.log.LogContextFilter.doFilter(LogContextFilter.java:45) [lspub-common-4.0.96-SNAPSHOT.jar:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at com.ebao.foundation.module.web.filter.SetCharacterEncodingFilter.executeFilter(SetCharacterEncodingFilter.java:39) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93) [iCP_iFoundation_Foundation_V3-LS4.2.13.jar:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556) [jetty-security-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372) [jetty-servlet-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.Server.handle(Server.java:369) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:944) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1005) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) [jetty-http-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) [jetty-http-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [jetty-server-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) [jetty-io-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) [jetty-io-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.14.v20131031.jar:7.6.14.v20131031]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.14.v20131031.jar:7.6.14.v20131031]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]
Caused by: org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
	at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:134) ~[spring-orm-4.3.4.RELEASE.jar:4.3.4.RELEASE]
	at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
	at com.ebao.ls.foundation.dao.support.GenericDaoSupport.getSession(GenericDaoSupport.java:168) ~[lspub-common-4.0.96-SNAPSHOT.jar:?]
	at com.ebao.ls.foundation.dao.support.DaoSupport.createCriteria(DaoSupport.java:45) ~[lspub-common-4.0.96-SNAPSHOT.jar:?]
	at com.ebao.ls.foundation.dao.support.GenericDaoSupport.findUniqueByProperty(GenericDaoSupport.java:153) ~[lspub-common-4.0.96-SNAPSHOT.jar:?]
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.findInstitutionTaxInfoById(GroupNbReviewEntryPoolAction.java:592) ~[classes/:?]
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.buildOrgCrsDTO(GroupNbReviewEntryPoolAction.java:440) ~[classes/:?]
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.buildOrgCrsDTOs(GroupNbReviewEntryPoolAction.java:435) ~[classes/:?]
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.companyCRSToEcif(GroupNbReviewEntryPoolAction.java:414) ~[classes/:?]
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.process(GroupNbReviewEntryPoolAction.java:180) ~[classes/:?]
	at com.ebao.pub.framework.GenericActionProxy.process(GenericActionProxy.java:36) ~[iCP_iFoundation_Foundation_V3_Proxy-LS4.2.13.jar:?]
	... 68 more
2020.12.22 10:22:13.854 [ERROR]57e94726-6937-4b78-b553-f84da463df86@qtp832337886-244 c.e.f.m.w.e.LogErrorInfoImpl []:Error Happen:
---------------20201222102213854.1001---------------
org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
	at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:134)
	at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014)
	at com.ebao.ls.foundation.dao.support.GenericDaoSupport.getSession(GenericDaoSupport.java:168)
	at com.ebao.ls.foundation.dao.support.DaoSupport.createCriteria(DaoSupport.java:45)
	at com.ebao.ls.foundation.dao.support.GenericDaoSupport.findUniqueByProperty(GenericDaoSupport.java:153)
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.findInstitutionTaxInfoById(GroupNbReviewEntryPoolAction.java:592)
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.buildOrgCrsDTO(GroupNbReviewEntryPoolAction.java:440)
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.buildOrgCrsDTOs(GroupNbReviewEntryPoolAction.java:435)
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.companyCRSToEcif(GroupNbReviewEntryPoolAction.java:414)
	at com.ebao.ls.grp.action.GroupNbReviewEntryPoolAction.process(GroupNbReviewEntryPoolAction.java:180)
	at com.ebao.pub.framework.GenericActionProxy.process(GenericActionProxy.java:36)
	at com.ebao.foundation.module.web.action.GenericNoTransAction._execute(GenericNoTransAction.java:159)
	at com.ebao.foundation.module.web.action.GenericCfgTransAction._execute(GenericCfgTransAction.java:63)
	at com.ebao.foundation.module.web.action.GenericCfgTransAction$1.doInTransaction(GenericCfgTransAction.java:44)
	at com.ebao.foundation.module.web.action.GenericCfgTransAction$1.doInTransaction(GenericCfgTransAction.java:40)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	at com.ebao.foundation.module.web.action.GenericCfgTransAction.execute(GenericCfgTransAction.java:40)
	at com.ebao.pub.framework.GenericAction.execute(GenericAction.java:51)
	at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
	at com.ebao.foundation.module.web.struts.BaseActionServlet.process(BaseActionServlet.java:1352)
	at com.ebao.foundation.module.web.struts.BaseActionServlet.doPost(BaseActionServlet.java:488)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1317)
	at com.ebao.foundation.module.security.filters.S2SAuthenticationFilter.executeFilter(S2SAuthenticationFilter.java:34)
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at com.ebao.foundation.module.web.filter.XssFilter.executeFilter(XssFilter.java:123)
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at com.ebao.foundation.module.security.filters.PermissionFilter.executeFilter(PermissionFilter.java:141)
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
	at com.ebao.foundation.module.security.filters.EBaoInternalLoginFilter.executeFilter(EBaoInternalLoginFilter.java:178)
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
	at com.ebao.foundation.module.security.filters.EBaoFilterChainProxy.doFilter(EBaoFilterChainProxy.java:75)
	at com.ebao.foundation.module.web.filter.FilterToBeanProxy.executeFilter(FilterToBeanProxy.java:34)
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at com.ebao.foundation.module.web.filter.ThreadBindResourceCleanFilter.executeFilter(ThreadBindResourceCleanFilter.java:67)
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at com.ebao.ls.pub.log.LogContextFilter._doFilter(LogContextFilter.java:61)
	at com.ebao.ls.pub.log.LogContextFilter.doFilter(LogContextFilter.java:45)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at com.ebao.foundation.module.web.filter.SetCharacterEncodingFilter.executeFilter(SetCharacterEncodingFilter.java:39)
	at com.ebao.foundation.module.web.filter.GenericFilter.doFilter(GenericFilter.java:93)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:369)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:944)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1005)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:748)

 

你可能感兴趣的:(error,error)