Spring Boot configuration SPRING-DATA-JPA error cannotcreatetransactionexception:could not open JPA Entitymanager for transaction; Nested exception is Java.lang.NoSuchMethodError

Source: Internet
Author: User
Tags aop

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.