Org.springframework.transaction.CannotCreateTransactionException:Could not open JPA Entitymanager forTransaction Nested exception is Java.lang.NoSuchMethodError:org.hibernate.Session.getFlushMode () lorg/hibernate/Flushmode; At Org.springframework.orm.jpa.JpaTransactionManager.doBegin (Jpatransactionmanager.java:431) at Org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction ( Abstractplatformtransactionmanager.java:378) at Org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary ( Transactionaspectsupport.java:474) at Org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction ( Transactionaspectsupport.java:289) at Org.springframework.transaction.interceptor.TransactionInterceptor.invoke (Transactioninterceptor.java: 98) at Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (Reflectivemethodinvocation.java: 185) at Org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke ( Persistenceexceptiontranslationinterceptor.java:139) at Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (Reflectivemethodinvocation.java: 185) at org.springframework.data.jpa.repository.support.crudmethodmetadatapostprocessor$ Crudmethodmetadatapopulatingmethodinterceptor.invoke (Crudmethodmetadatapostprocessor.java:135) at Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (Reflectivemethodinvocation.java: 185) at Org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke (Exposeinvocationinterceptor.java :92) at Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (Reflectivemethodinvocation.java: 185) at Org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke (Surroundingtransactiondetectormethodinterceptor.java:61) at Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (Reflectivemethodinvocation.java: 185) at Org.springframework.aop.framework.JdkDynamicAopProxy.invoke (Jdkdynamicaopproxy.java:212) at Com.sun.proxy. $Proxy 82.save (Unknown Source) at Com.ssm.springboot.Springboot14ApplicationTests.test (Spring Boot14applicationtests.java:28) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java:62) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (Method.java:498) at org.junit.runners.model.frameworkmethod$1.runReflectiveCall (frameworkmethod.java:50) at Org.junit.internal.runners.model.ReflectiveCallable.run (Reflectivecallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively (Frameworkmethod.java:47) at Org.junit.internal.runners.statements.InvokeMethod.evaluate (Invokemethod.java:17) at Org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate ( Runbeforetestexecutioncallbacks.java:73) at Org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate ( Runaftertestexecutioncallbacks.java:83) at Org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate ( Runbeforetestmethodcallbacks.java:75) at Org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate ( Runaftertestmethodcallbacks.java:86) at Org.springframework.test.context.junit4.statements.SpringRepeat.evaluate (Springrepeat
Initially thought to be its own configuration problem, after the check found no error
May be a jar package conflict after analysis
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm< /artifactid> <version>4.2.5.RELEASE</version> </dependency>
Upgrade the Spring-orm jar package to a higher version problem resolution
Spring Boot configuration SPRING-DATA-JPA error cannotcreatetransactionexception:could not open JPA Entitymanager for transaction; Nested exception is Java.lang.NoSuchMethodError