org.springframework.dao.InvalidDataAccessApiUsageException

No transactional EntityManager available; nested exception is javax.persistence.TransactionRequiredException: No transactional EntityManager available

Samebug tips0

There are no available Samebug tips.

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

Solutions on the web56

Stack trace

  • org.springframework.dao.InvalidDataAccessApiUsageException: No transactional EntityManager available; nested exception is javax.persistence.TransactionRequiredException: No transactional EntityManager available at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:410)[EntityManagerFactoryUtils.class:4.1.6.RELEASE] at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:223)[HibernateJpaDialect.class:4.1.6.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:417)[AbstractEntityManagerFactoryBean.class:4.1.6.RELEASE] at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)[ChainedPersistenceExceptionTranslator.class:4.1.6.RELEASE] at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)[DataAccessUtils.class:4.1.6.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)[PersistenceExceptionTranslationInterceptor.class:4.1.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[ReflectiveMethodInvocation.class:4.1.6.RELEASE] at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodIntercceptor.invoke(CrudMethodMetadataPostProcessor.java:122)[CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodIntercceptor.class:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[ReflectiveMethodInvocation.class:4.1.6.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)[ExposeInvocationInterceptor.class:4.1.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[ReflectiveMethodInvocation.class:4.1.6.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)[JdkDynamicAopProxy.class:4.1.6.RELEASE] at com.sun.proxy.$Proxy110.deleteByCustomerId(Unknown Source)[na:na] Caused by: javax.persistence.TransactionRequiredException: No transactional EntityManager available at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:275)[SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.class:4.1.6.RELEASE] at com.sun.proxy.$Proxy102.remove(Unknown Source)[na:na] at org.springframework.data.jpa.repository.query.JpaQueryExecution$DeleteExecution.doExecute(JpaQueryExecution.java:270)[JpaQueryExecution$DeleteExecution.class:na] at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:74)[JpaQueryExecution.class:na] at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:97)[AbstractJpaQuery.class:na] at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:88)[AbstractJpaQuery.class:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:395)[RepositoryFactorySupport$QueryExecutorMethodInterceptor.class:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:373)[RepositoryFactorySupport$QueryExecutorMethodInterceptor.class:na]

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

SteVio1989SteVio1989
4 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
20 more bugmates