org.springframework.transaction.CannotCreateTransactionException

Could not open Hibernate Session for transaction; nested exception is java.lang.NullPointerException

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web436

  • Could not open Hibernate Session for transaction; nested exception is java.lang.NullPointerException
  • via hsqldb by hsetty
    , 1 year ago
    Could not open Hibernate Session for transaction; nested exception is java.lang.NullPointerException
  • Could not open Hibernate Session for transaction; nested exception is java.lang.NullPointerException
  • Stack trace

    • org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.NullPointerException at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:544)[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)[spring-tx-4.3.0.RELEASE.jar:4.3.0.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:427)[spring-tx-4.3.0.RELEASE.jar:4.3.0.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276)[spring-tx-4.3.0.RELEASE.jar:4.3.0.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)[spring-tx-4.3.0.RELEASE.jar:4.3.0.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)[spring-aop-4.2.7.RELEASE.jar:4.2.7.RELEASE] at com.sun.proxy.$Proxy135.getConfigurationValueByTypeAndKey(Unknown Source)[na:na] at com.project.name.LoginView.prepareContent(LoginView.java:237)[web-3.0.jar:na] at com.project.name.LoginView.<init>(LoginView.java:36)[web-3.0.jar:na] at com.project.name.nameMain.goToLogin(nameMain.java:125)[web-3.0.jar:na] at com.project.name.HomeView$4.buttonClick(HomeView.java:84)[web-3.0.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_91] at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1008)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.ui.Button.fireClick(Button.java:377)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.ui.Button$1.click(Button.java:54)[vaadin-server-7.6.7.jar:7.6.7] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_91] at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:158)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:408)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:273)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:79)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1409)[vaadin-server-7.6.7.jar:7.6.7] at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:364)[vaadin-server-7.6.7.jar:7.6.7] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)[javax.servlet-api-3.1.0.jar:3.1.0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)[tomcat-embed-websocket-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:281)[spring-boot-actuator-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:115)[spring-boot-actuator-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103)[spring-boot-actuator-1.3.6.RELEASE.jar:1.3.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.7.RELEASE.jar:4.2.7.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)[tomcat-embed-core-8.0.36.jar:8.0.36] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)[tomcat-embed-core-8.0.36.jar:8.0.36] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_91] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-embed-core-8.0.36.jar:8.0.36] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_91] Caused by: java.lang.NullPointerException: null at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.reset(TransactionCoordinatorImpl.java:130)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.<init>(TransactionCoordinatorImpl.java:94)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.internal.SessionImpl.<init>(SessionImpl.java:258)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.internal.SessionFactoryImpl$SessionBuilderImpl.openSession(SessionFactoryImpl.java:1589)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.hibernate.internal.SessionFactoryImpl.openSession(SessionFactoryImpl.java:999)[hibernate-core-4.3.11.Final.jar:4.3.11.Final] at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:436)[spring-orm-4.2.7.RELEASE.jar:4.2.7.RELEASE] ... 84 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 11 months ago
    11 times, 1 year ago
    Unknown user
    Once, 1 year ago