org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'startupDbDataInit': Invocation of init method failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode;

Stack Overflow | Guyb | 4 months ago
  1. 0

    Spring 4.3.0.RELEASE + Hibernate 5.2.0.Final + JPA Repository

    Stack Overflow | 4 months ago | Guyb
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'startupDbDataInit': Invocation of init method failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode;
  2. 0

    NPE in Hibernate when Connection accessed from thread that did not create it

    GitHub | 3 years ago | brettwooldridge
    org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.NullPointerException
  3. 0

    Strange and rare DB related exception

    Stack Overflow | 3 years ago | Benjamin Szabo
    org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin transaction failed:
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JAXB related exception | java - web-services - jaxb - classcastexception

    solutionscore.com | 1 year ago
    org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin transaction failed:
  6. 0

    google cloudsql + google app engine + spring mvc + hierbnate/jpa error

    Stack Overflow | 3 years ago | badri
    org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection

  1. Piz 1 times, last 5 months ago
  2. tvrmsmith 1 times, last 4 months ago
  3. linxiaolong 1 times, last 4 months ago
  4. mauritius 2 times, last 9 months ago
15 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. java.lang.NoSuchMethodError

    org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode;

    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareFlushMode()
  2. Spring ORM
    JpaTransactionManager.doBegin
    1. org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareFlushMode(HibernateJpaDialect.java:187)
    2. org.springframework.orm.jpa.vendor.HibernateJpaDialect.beginTransaction(HibernateJpaDialect.java:173)
    3. org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:380)
    3 frames
  3. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
    2. org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:427)
    3. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276)
    4. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    4 frames
  4. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    1 frame
  5. Spring Tx
    PersistenceExceptionTranslationInterceptor.invoke
    1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
    1 frame
  6. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    1 frame
  7. Spring Data JPA
    CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke
    1. org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
    1 frame
  8. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    2. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    4. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    4 frames
  9. com.sun.proxy
    $Proxy83.count
    1. com.sun.proxy.$Proxy83.count(Unknown Source)
    1 frame
  10. com.test.startup
    StartupDbDataInit.onApplicationInit
    1. com.test.startup.StartupDbDataInit.onApplicationInit(StartupDbDataInit.java:38)
    1 frame
  11. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    4. java.lang.reflect.Method.invoke(Unknown Source)
    4 frames
  12. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365)
    2. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:310)
    3. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    12. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:775)
    12 frames
  13. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    2 frames
  14. Spring
    ContextLoaderListener.contextInitialized
    1. org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
    2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
    3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    3 frames
  15. Glassfish Core
    ContainerBase$ContainerBackgroundProcessor.run
    1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842)
    2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
    3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    4. org.apache.catalina.core.StandardContext.reload(StandardContext.java:3858)
    5. org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:291)
    6. org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5660)
    7. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1376)
    8. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1380)
    9. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1380)
    10. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1348)
    10 frames
  16. Java RT
    Thread.run
    1. java.lang.Thread.run(Unknown Source)
    1 frame