org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction

Spring JIRA | Nicolas Labrot | 5 months ago
  1. 0

    Error creating bean with name 'jpaAuditingHandler' on application shutdown

    Stack Overflow | 5 months ago | Nicolas Labrot
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction
  2. 0

    Hello, When my application shutdown I got this exception: {code} org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:526) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at com.victorbuckservices.vbackbone.common.transaction.DoInTransactionService$$EnhancerBySpringCGLIB$$4c864b6e.execute(<generated>) at com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService.particularRslFolderPolling(DistributionFaxService.java:757) at com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService.rslPolling(DistributionFaxService.java:723) at com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService$$FastClassBySpringCGLIB$$7c544f09.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:651) at com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService$$EnhancerBySpringCGLIB$$75a0516b.rslPolling(<generated>) at com.victorbuckservices.vbackbone.service.distribution.fax.quartz.PollingJob.execute(PollingJob.java:28) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: javax.persistence.RollbackException: Error while committing the transaction at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:94) at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517) ... 17 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'jpaAuditingHandler': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!) {code} Some tasks must be finished prior to the shutdown and because spring is shutting down, it forbids call to DefaultSingletonBeanRegistry#getSingleton and thus AuditingEntityListener#touchForUpdate failed because he used an ObjectFactory<AuditingHandler>: {code:java} @PreUpdate public void touchForUpdate(Object target) { if (handler != null) { handler.getObject().markModified(target); } } {code}

    Spring JIRA | 5 months ago | Nicolas Labrot
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction
  3. 0

    Constraint error

    GitHub | 2 years ago | Cabbina
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOnly
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Can't commit JPA transaction - RollbackException: Transaction marked as rollbackOnly

    Stack Overflow | 10 months ago | JONIVar
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOnly
  6. 0

    Hibernate NamedQuery and Pagination

    Stack Overflow | 2 years ago | DruidKuma
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOnly

  1. Malcshour 6 times, last 6 months ago
  2. thiago.santos 10 times, last 7 months ago
7 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. javax.persistence.RollbackException

    Error while committing the transaction

    at org.hibernate.jpa.internal.TransactionImpl.commit()
  2. org.hibernate.jpa
    TransactionImpl.commit
    1. org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:94)
    1 frame
  3. Spring ORM
    JpaTransactionManager.doCommit
    1. org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)
    1 frame
  4. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
    2. org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
    3. org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485)
    4. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)
    5. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    5 frames
  5. Spring AOP
    CglibAopProxy$DynamicAdvisedInterceptor.intercept
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    2. org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
    2 frames
  6. com.victorbuckservices.vbackbone
    DistributionFaxService$$FastClassBySpringCGLIB$$7c544f09.invoke
    1. com.victorbuckservices.vbackbone.common.transaction.DoInTransactionService$$EnhancerBySpringCGLIB$$4c864b6e.execute(<generated>)
    2. com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService.particularRslFolderPolling(DistributionFaxService.java:757)
    3. com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService.rslPolling(DistributionFaxService.java:723)
    4. com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService$$FastClassBySpringCGLIB$$7c544f09.invoke(<generated>)
    4 frames
  7. Spring Core
    MethodProxy.invoke
    1. org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    1 frame
  8. Spring AOP
    CglibAopProxy$DynamicAdvisedInterceptor.intercept
    1. org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:651)
    1 frame
  9. com.victorbuckservices.vbackbone
    PollingJob.execute
    1. com.victorbuckservices.vbackbone.service.distribution.fax.service.DistributionFaxService$$EnhancerBySpringCGLIB$$75a0516b.rslPolling(<generated>)
    2. com.victorbuckservices.vbackbone.service.distribution.fax.quartz.PollingJob.execute(PollingJob.java:28)
    2 frames
  10. quartz
    SimpleThreadPool$WorkerThread.run
    1. org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    2. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
    2 frames