org.springframework.dao.DataAccessResourceFailureException: Could not obtain current Hibernate Session; nested exception is org.hibernate.HibernateException: No Session found for current thread

GitHub | antondelpiero | 6 months ago
  1. 0

    GitHub comment 287#228540604

    GitHub | 6 months ago | antondelpiero
    org.springframework.dao.DataAccessResourceFailureException: Could not obtain current Hibernate Session; nested exception is org.hibernate.HibernateException: No Session found for current thread
  2. 0

    "Could not obtain current Hibernate Session" in 3.0.0-RC1 with Grails 3.1.x

    GitHub | 8 months ago | klnprj
    org.springframework.security.authentication.InternalAuthenticationServiceException: Could not obtain current Hibernate Session; nested exception is org.hibernate.HibernateException: No Session found for current thread
  3. 0

    GitHub comment 378#146889021

    GitHub | 1 year ago | VenelinPetkov
    org.springframework.security.authentication.InternalAuthenticationServiceException: Could not obtain current Hibernate Session; nested exception is org.hibernate.HibernateException: No Session found for current thread
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GORM objects not persist-able in Integration Test fixture methods

    GitHub | 1 year ago | joemccall86
    org.hibernate.HibernateException: No Session found for current thread
  6. 0

    Grails 3.0.8 integration test rollback 'No Session found for current thread'

    GitHub | 1 year ago | olliefreeman
    org.hibernate.HibernateException: No Session found for current thread

  1. Luka 6 times, last 2 months ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hibernate.HibernateException

    No Session found for current thread

    at org.grails.orm.hibernate.GrailsSessionContext.currentSession()
  2. Grails GORM
    GrailsSessionContext.currentSession
    1. org.grails.orm.hibernate.GrailsSessionContext.currentSession(GrailsSessionContext.java:117)[grails-datastore-gorm-hibernate4-5.0.1.RELEASE.jar:na]
    1 frame
  3. Hibernate
    SessionFactoryImpl.getCurrentSession
    1. org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014)[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
    1 frame
  4. Grails GORM
    AbstractHibernateGormStaticApi.findWhere
    1. org.grails.orm.hibernate.SessionFactoryProxy.getCurrentSession(SessionFactoryProxy.java:148)[grails-datastore-gorm-hibernate4-5.0.1.RELEASE.jar:na]
    2. org.grails.orm.hibernate.GrailsHibernateTemplate.getSession(GrailsHibernateTemplate.java:225)[grails-datastore-gorm-hibernate4-5.0.1.RELEASE.jar:na]
    3. org.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:183)[grails-datastore-gorm-hibernate4-5.0.1.RELEASE.jar:na]
    4. org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:140)[grails-datastore-gorm-hibernate4-5.0.1.RELEASE.jar:na]
    5. org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:110)[grails-datastore-gorm-hibernate4-5.0.1.RELEASE.jar:na]
    6. org.grails.orm.hibernate.AbstractHibernateGormStaticApi.findWhere(AbstractHibernateGormStaticApi.groovy:335)[grails-datastore-gorm-hibernate-core-5.0.1.RELEASE.jar:na]
    6 frames
  5. Grails GORM
    GormEntity$Trait$Helper$findWhere.call
    1. org.grails.datastore.gorm.GormStaticApi.findWhere(GormStaticApi.groovy:648)[grails-datastore-gorm-5.0.1.RELEASE.jar:na]
    2. org.grails.datastore.gorm.GormEntity$Trait$Helper.findWhere(GormEntity.groovy:830)[grails-datastore-gorm-5.0.1.RELEASE.jar:na]
    3. org.grails.datastore.gorm.GormEntity$Trait$Helper$findWhere.call(Unknown Source)[na:na]
    3 frames
  6. Groovy
    AbstractCallSite.call
    1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)[groovy-2.4.5.jar:2.4.5]
    2. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)[groovy-2.4.5.jar:2.4.5]
    3. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)[groovy-2.4.5.jar:2.4.5]
    3 frames
  7. com.r2b.security
    User$findWhere.call
    1. com.r2b.security.User.findWhere(User.groovy)[main/:na]
    2. com.r2b.security.User$findWhere.call(Unknown Source)[na:na]
    2 frames
  8. Groovy
    AbstractCallSite.call
    1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)[groovy-2.4.5.jar:2.4.5]
    2. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)[groovy-2.4.5.jar:2.4.5]
    3. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)[groovy-2.4.5.jar:2.4.5]
    3 frames
  9. grails.plugin.springsecurity
    GormUserDetailsService$_loadUserByUsername_closure1.doCall
    1. grails.plugin.springsecurity.userdetails.GormUserDetailsService.$tt__loadUserByUsername(GormUserDetailsService.groovy:60)[spring-security-core-3.0.2.jar:na]
    2. grails.plugin.springsecurity.userdetails.GormUserDetailsService$_loadUserByUsername_closure1.doCall(GormUserDetailsService.groovy)[spring-security-core-3.0.2.jar:na]
    2 frames
  10. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_25]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_25]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_25]
    4. java.lang.reflect.Method.invoke(Method.java:483)[na:1.8.0_25]
    4 frames
  11. Springloaded
    ReflectiveInterceptor.jlrMethodInvoke
    1. org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)[springloaded-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    1 frame
  12. Groovy
    Closure.call
    1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)[groovy-2.4.5.jar:2.4.5]
    2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)[groovy-2.4.5.jar:2.4.5]
    3. org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)[groovy-2.4.5.jar:2.4.5]
    4. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)[groovy-2.4.5.jar:2.4.5]
    5. groovy.lang.Closure.call(Closure.java:426)[groovy-2.4.5.jar:2.4.5]
    6. groovy.lang.Closure.call(Closure.java:442)[groovy-2.4.5.jar:2.4.5]
    6 frames
  13. Grails
    GrailsTransactionTemplate$2.doInTransaction
    1. grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:96)[grails-core-3.1.1.jar:3.1.1]
    1 frame
  14. Spring Tx
    TransactionTemplate.execute
    1. org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  15. Grails
    GrailsTransactionTemplate.execute
    1. grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)[grails-core-3.1.1.jar:3.1.1]
    1 frame
  16. grails.plugin.springsecurity
    GormUserDetailsService.loadUserByUsername
    1. grails.plugin.springsecurity.userdetails.GormUserDetailsService.loadUserByUsername(GormUserDetailsService.groovy)[spring-security-core-3.0.2.jar:na]
    2. grails.plugin.springsecurity.userdetails.GormUserDetailsService.loadUserByUsername(GormUserDetailsService.groovy:71)[spring-security-core-3.0.2.jar:na]
    2 frames
  17. spring-security-core
    AuthenticationManager$authenticate.call
    1. org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:114)[spring-security-core-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    2. org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:143)[spring-security-core-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    3. org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:167)[spring-security-core-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    4. org.springframework.security.authentication.AuthenticationManager$authenticate.call(Unknown Source)[spring-security-core-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    4 frames
  18. Groovy
    AbstractCallSite.call
    1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)[groovy-2.4.5.jar:2.4.5]
    2. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)[groovy-2.4.5.jar:2.4.5]
    3. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)[groovy-2.4.5.jar:2.4.5]
    3 frames
  19. grails.plugin.springsecurity
    RestAuthenticationFilter.doFilter
    1. grails.plugin.springsecurity.rest.RestAuthenticationFilter.doFilter(RestAuthenticationFilter.groovy:104)[spring-security-rest-2.0.0.M2.jar:na]
    1 frame
  20. Spring Security
    FilterChainProxy$VirtualFilterChain.doFilter
    1. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    1 frame
  21. grails.plugin.springsecurity
    MutableLogoutFilter.doFilter
    1. grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62)[spring-security-core-3.0.2.jar:na]
    1 frame
  22. Spring Security
    FilterChainProxy$VirtualFilterChain.doFilter
    1. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    1 frame
  23. grails.plugin.springsecurity
    SecurityRequestHolderFilter.doFilter
    1. grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58)[spring-security-core-3.0.2.jar:na]
    1 frame
  24. Spring Security
    FilterChainProxy.doFilter
    1. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    2. org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    3. org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE]
    3 frames
  25. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2 frames
  26. org.grails.web
    GrailsWebRequestFilter.doFilterInternal
    1. org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:73)[grails-web-mvc-3.1.1.jar:3.1.1]
    1 frame
  27. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  28. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2 frames
  29. org.grails.web
    HiddenHttpMethodFilter.doFilterInternal
    1. org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)[grails-web-mvc-3.1.1.jar:3.1.1]
    1 frame
  30. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  31. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2 frames
  32. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2 frames
  33. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2 frames
  34. Spring Boot Actuator
    MetricsFilter.doFilterInternal
    1. org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103)[spring-boot-actuator-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    1 frame
  35. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  36. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[tomcat-embed-core-8.0.30.jar:8.0.30]
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)[tomcat-embed-core-8.0.30.jar:8.0.30]
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)[tomcat-embed-core-8.0.30.jar:8.0.30]
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)[tomcat-embed-core-8.0.30.jar:8.0.30]
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)[tomcat-embed-core-8.0.30.jar:8.0.30]
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)[tomcat-embed-core-8.0.30.jar:8.0.30]
    8. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)[tomcat-embed-core-8.0.30.jar:8.0.30]
    9. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)[tomcat-embed-core-8.0.30.jar:8.0.30]
    9 frames
  37. Grizzly HTTP
    NioEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)[tomcat-embed-core-8.0.30.jar:8.0.30]
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)[tomcat-embed-core-8.0.30.jar:8.0.30]
    3. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)[tomcat-embed-core-8.0.30.jar:8.0.30]
    4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)[tomcat-embed-core-8.0.30.jar:8.0.30]
    4 frames
  38. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_25]
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_25]
    2 frames
  39. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-embed-core-8.0.30.jar:8.0.30]
    1 frame
  40. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)[na:1.8.0_25]
    1 frame