java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: No bean named 'transactionManager' is defined

tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Working with Spring Data JPA, Hibernate and multiple transaction manager: No bean named 'transactionManager' is defined

    Stack Overflow | 4 years ago | ThanksForAllTheFish
    java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: No bean named 'transactionManager' is defined
  2. 0

    According to [reference documentation| http://docs.spring.io/spring-data/jpa/docs/1.4.1.RELEASE/reference/html/jpa.repositories.html#jpa.namespace-attributes] the property {{transaction-manager-ref}} in element {{<jpa:repositories />}} can be omitted when there is only one {{PlatformTransactionManager}} in spring context. Unfortunately this is not true and one can spend some time to realize that this property should be explicitly specified when {{PlatformTransactionManager}} bean name is not {{transactionManager}}. I prepare test case, it can be accessed in my github: https://github.com/wjtk/spring-data-jpa-one-tx-bug There are three tests corresponding to profiles in xml context file. # {{TransactionManagerTest}} - tx manager is named {{transactionManger}} everything is ok. # {{TxManagerExplicitTest}} - tx manager is named {{txManager}}, not standard, but is explicitly set in {{<jpa:repositories />}}, everything is ok # {{TxManagerTest}} - tx manager is named {{txManager}} and {{<jpa:repositories />}} has no {{transaction-manager-ref}} property. This should be ok according to reference but test method fails and I get stacktrace: {noformat} org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:570) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1108) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:331) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:250) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor$LockModePopulatingMethodIntercceptor.invoke(LockModeRepositoryPostProcessor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy25.save(Unknown Source) at wkr.test.spring.bug.BaseTest.should_save_entity_through_data_jpa_repository(BaseTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:200) at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:155) {noformat}

    Spring JIRA | 3 years ago | Wojciech Krak
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
  3. 0

    When using a custom transaction manager name, the junit tests on the repository layer fail because it does not find the transaction manager named "transactionManager". See exception below: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1108) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:331) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:250) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor$LockModePopulatingMethodIntercceptor.invoke(LockModeRepositoryPostProcessor.java:91) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy39.findAll(Unknown Source) The project is generated with roo with repository layer. It seems that roo does not use the custom named transaction manager in the applicationContext-jpa.xml. When defining the custom name, the exception is not thrown. <repositories base-package="com.package.traducteur" transaction-manager-ref="tradTM" />

    Spring JIRA | 3 years ago | Adrien Ferre
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    According to [reference documentation| http://docs.spring.io/spring-data/jpa/docs/1.4.1.RELEASE/reference/html/jpa.repositories.html#jpa.namespace-attributes] the property {{transaction-manager-ref}} in element {{<jpa:repositories />}} can be omitted when there is only one {{PlatformTransactionManager}} in spring context. Unfortunately this is not true and one can spend some time to realize that this property should be explicitly specified when {{PlatformTransactionManager}} bean name is not {{transactionManager}}. I prepare test case, it can be accessed in my github: https://github.com/wjtk/spring-data-jpa-one-tx-bug There are three tests corresponding to profiles in xml context file. # {{TransactionManagerTest}} - tx manager is named {{transactionManger}} everything is ok. # {{TxManagerExplicitTest}} - tx manager is named {{txManager}}, not standard, but is explicitly set in {{<jpa:repositories />}}, everything is ok # {{TxManagerTest}} - tx manager is named {{txManager}} and {{<jpa:repositories />}} has no {{transaction-manager-ref}} property. This should be ok according to reference but test method fails and I get stacktrace: {noformat} org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:570) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1108) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:331) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:250) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor$LockModePopulatingMethodIntercceptor.invoke(LockModeRepositoryPostProcessor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy25.save(Unknown Source) at wkr.test.spring.bug.BaseTest.should_save_entity_through_data_jpa_repository(BaseTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:200) at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:155) {noformat}

    Spring JIRA | 3 years ago | Wojciech Krak
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
  6. 0

    When using a custom transaction manager name, the junit tests on the repository layer fail because it does not find the transaction manager named "transactionManager". See exception below: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1108) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:331) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:250) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor$LockModePopulatingMethodIntercceptor.invoke(LockModeRepositoryPostProcessor.java:91) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy39.findAll(Unknown Source) The project is generated with roo with repository layer. It seems that roo does not use the custom named transaction manager in the applicationContext-jpa.xml. When defining the custom name, the exception is not thrown. <repositories base-package="com.package.traducteur" transaction-manager-ref="tradTM" />

    Spring JIRA | 3 years ago | Adrien Ferre
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined

  1. Hronom 1 times, last 2 months ago
  2. batwalrus76 1 times, last 2 months ago
  3. gehel 2 times, last 3 months ago
  4. Andreas Häber 4 times, last 4 months ago
  5. Luka 1 times, last 4 months ago
5 more registered users
52 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. org.springframework.beans.factory.NoSuchBeanDefinitionException

    No bean named 'transactionManager' is defined

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition()
  2. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568)
    2. org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1099)
    3. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278)
    4. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    4 frames
  3. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionAspectSupport.determineTransactionManager(TransactionAspectSupport.java:246)
    2. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
    2 frames
  4. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    1 frame
  5. Spring Tx
    PersistenceExceptionTranslationInterceptor.invoke
    1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
    1 frame
  6. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    1 frame
  7. Spring Data JPA
    LockModeRepositoryPostProcessor$LockModePopulatingMethodIntercceptor.invoke
    1. org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor$LockModePopulatingMethodIntercceptor.invoke(LockModeRepositoryPostProcessor.java:92)
    1 frame
  8. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    3 frames
  9. Spring Tx
    PersistenceExceptionTranslationInterceptor.invoke
    1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
    1 frame
  10. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    2 frames
  11. sun.proxy
    $Proxy98.save
    1. sun.proxy.$Proxy98.save(Unknown Source)
    1 frame
  12. myModule.package
    SomeOtherClass$$FastClassByCGLIB$$2bda5a73.invoke
    1. myModule.package.SomeOtherClass.someOtherMethod(SomeOtherClass.java:114)
    2. myModule.package.SomeOtherClass$$FastClassByCGLIB$$2bda5a73.invoke(<generated>)
    2 frames
  13. Spring Core
    MethodProxy.invoke
    1. org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    1 frame
  14. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    2 frames
  15. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    1 frame
  16. Spring AOP
    CglibAopProxy$DynamicAdvisedInterceptor.intercept
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
    2 frames
  17. myModule.package
    SomeClass.someMethod
    1. myModule.package.SomeClass$$EnhancerByCGLIB$$37044080.myMethod(<generated>)
    2. myModule.package.SomeClass.someMethod(SomeClass.java:64)
    2 frames
  18. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  19. Apache CXF Core
    AbstractInvoker.invoke
    1. org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
    2. org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
    2 frames
  20. Apache CXF Runtime JAX-RS Frontend
    JAXRSInvoker.invoke
    1. org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)
    2. org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)
    2 frames
  21. Apache CXF Core
    ServiceInvokerInterceptor$1.run
    1. org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
    1 frame
  22. Java RT
    FutureTask.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
    3 frames
  23. Apache CXF Core
    ChainInitiationObserver.onMessage
    1. org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
    2. org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
    3. org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    4. org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
    4 frames
  24. Apache CXF Runtime HTTP Transport
    AbstractHTTPServlet.doGet
    1. org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
    2. org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
    3. org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
    4. org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
    5. org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
    6. org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:113)
    6 frames
  25. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    1 frame
  26. Apache CXF Runtime HTTP Transport
    AbstractHTTPServlet.service
    1. org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
    1 frame
  27. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    10 frames
  28. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    3 frames
  29. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    3. java.lang.Thread.run(Thread.java:662)
    3 frames