java.lang.IllegalStateException: No matching PlatformTransactionManager bean found for qualifier 'myQualifier' - neither qualifier match nor bean name match!

Spring JIRA | James Shaw | 6 years ago
  1. 0

    When I specify qualifier for @Transactional annotation and the specified PlatformTransactionManager is defined in parent context, the exception is thrown like following: {code} java.lang.IllegalStateException: No matching PlatformTransactionManager bean found for qualifier 'transactionManagerExt' - neither qualifier match nor bean name match! at org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:91) at org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:53) at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:245) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621) {code} For example, if the autowired bean with {{@Transactional}}-marked method is being parsed in servlet-level context, but {{transactionManager}} is specified in the global web-application context, defined by {{contextConfigLocation}} param in web.xml. So actually Spring does not take in account here parent contexts. Investigating the code I have found the class {{TransactionAspectUtils}} with the following method {{isQualifierMatch()}} which uses {{bf.containsBeanDefinition}} method which of course is not parent-aware! My suggestion is to change this method call either to {{bf.containsBean}} or to implement recursive bean searching through contexts hierarchy.

    Spring JIRA | 6 years ago | Derar Bakr
    java.lang.IllegalStateException: No matching PlatformTransactionManager bean found for qualifier 'transactionManagerExt' - neither qualifier match nor bean name match!
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    When I specify qualifier for @Transactional annotation and the specified PlatformTransactionManager is defined in parent context, the exception is thrown like following: {code} java.lang.IllegalStateException: No matching PlatformTransactionManager bean found for qualifier 'transactionManagerExt' - neither qualifier match nor bean name match! at org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:91) at org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:53) at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:245) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621) {code} For example, if the autowired bean with {{@Transactional}}-marked method is being parsed in servlet-level context, but {{transactionManager}} is specified in the global web-application context, defined by {{contextConfigLocation}} param in web.xml. So actually Spring does not take in account here parent contexts. Investigating the code I have found the class {{TransactionAspectUtils}} with the following method {{isQualifierMatch()}} which uses {{bf.containsBeanDefinition}} method which of course is not parent-aware! My suggestion is to change this method call either to {{bf.containsBean}} or to implement recursive bean searching through contexts hierarchy.

    Spring JIRA | 6 years ago | Derar Bakr
    java.lang.IllegalStateException: No matching PlatformTransactionManager bean found for qualifier 'transactionManagerExt' - neither qualifier match nor bean name match!
  4. 0

    JTA EntityManager cannot use getTransaction() [Spring + Hibernate + EntityManager]

    Stack Overflow | 5 years ago | Vivek Ragunathan
    java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction() 15:47:44,125 INFO [STDOUT] at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:818) 15:47:44,126 INFO [STDOUT] at org.springframework.orm.jpa.JpaTransactionManager.closeEntityManagerAfterFailedBegin(JpaTransactionManager.java:412) 15:47:44,127 INFO [STDOUT] at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:381) 15:47:44,128 INFO [STDOUT] at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)

    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.IllegalStateException

      No matching PlatformTransactionManager bean found for qualifier 'myQualifier' - neither qualifier match nor bean name match!

      at org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager()
    2. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:91)
      2. org.springframework.transaction.interceptor.TransactionAspectUtils.getTransactionManager(TransactionAspectUtils.java:53)
      3. org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:245)
      4. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
      4 frames