No bean could be found in the registry of type: PlatformTransactionManager
Environment
- Red Hat JBoss Fuse (Fuse)
- 6.1
Issue
- When I run Fuse 6.1 in standalone mode (no Fabric in this case) and deploy the following route I get exceptions:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:inbox?username=admin&password=admin"/>
<transacted/>
<to uri="activemq:outbox?username=admin&password=admin"/>
</route>
</camelContext>
- This exception is logged, and the route fails to start:
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route2 at: >>> Transacted[] <<< in route: Route(route2)[[From[activemq:inbox?username=admin&password=a... because of No bean could be found in the registry of type: PlatformTransactionManager
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1363)[org.apache.camel:camel-core:2.12.0.redhat-610379 com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4]
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)[org.apache.camel:camel-spring:2.12.0.redhat-610379]
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:303)[org.apache.camel:camel-spring:2.12.0.redhat-610379]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)[org.apache.servicemix.bundles:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)[org.apache.servicemix.bundles:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)[org.apache.servicemix.bundles:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)[org.springframework.osgi:spring-osgi-core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)[org.springframework.osgi:spring-osgi-core:1.2.1]
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[org.springframework.osgi:spring-osgi-core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[org.springframework.osgi:spring-osgi-core:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[org.springframework.osgi:spring-osgi-extender:1.2.1]
at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
Resolution
Add the reference to the PlatformTransactionManager to the Spring file:
<osgi:reference id="osgiPlatformTransactionManager" interface="org.springframework.transaction.PlatformTransactionManager"/>
You need to import the service reference explicitly from the OSGi registry into Spring module in order to make it visible to the Spring.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
