Blueprint camel route with errorHandlerRef to an explicitly configured transaction error handler bean throws exception when container shutdown

Solution In Progress - Updated -

Issue

We're migrating our camel contexts from Spring to Blueprint. These contexts contain a couple of transactional error handlers e.g.

    <bean id="mqErrorHandler" class="org.apache.camel.spring.spi.TransactionErrorHandlerBuilder">
        <property name="springTransactionPolicy" ref="mqTransactionPolicy"/>
    </bean>

And the transaction error handler bean is referenced from blueprint camel route in another blueprint xml file:

<camelContext errorHandlerRef="mqErrorHandler" xmlns="http://camel.apache.org/schema/blueprint">
...

But when the container is shutting down, follow exception is thrown:

2015-08-07 13:51:01,169 | WARN  | FelixShutdown    | faultManagementLifecycleStrategy | 110 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Could not unregister error handler: org.apache.camel.management.mbean.ManagedErrorHandler@15c870a as ErrorHandler MBean.
org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: mqErrorHandler of type: org.apache.camel.builder.ErrorHandlerBuilder
    at org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:159)
    at org.apache.camel.impl.DefaultRouteContext.mandatoryLookup(DefaultRouteContext.java:151)
    at org.apache.camel.builder.ErrorHandlerBuilderRef.lookupErrorHandlerBuilder(ErrorHandlerBuilderRef.java:137)
    at org.apache.camel.management.DefaultManagementNamingStrategy.getObjectNameForErrorHandler(DefaultManagementNamingStrategy.java:154)
    at org.apache.camel.management.ManagedManagementStrategy.getManagedObjectName(ManagedManagementStrategy.java:104)
    at org.apache.camel.management.ManagedManagementStrategy.unmanageObject(ManagedManagementStrategy.java:143)
    at org.apache.camel.management.DefaultManagementLifecycleStrategy.unmanageObject(DefaultManagementLifecycleStrategy.java:839)
    at org.apache.camel.management.DefaultManagementLifecycleStrategy.onErrorHandlerRemove(DefaultManagementLifecycleStrategy.java:638)
    at org.apache.camel.impl.RouteService.stopChildService(RouteService.java:351)
    at org.apache.camel.impl.RouteService.doStop(RouteService.java:237)
    at org.apache.camel.support.ChildServiceSupport.stop(ChildServiceSupport.java:77)
    at org.apache.camel.support.ChildServiceSupport.stop(ChildServiceSupport.java:101)
    at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:141)
    at org.apache.camel.util.ServiceHelper.stopAndShutdownService(ServiceHelper.java:204)
    at org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2827)
    at org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2852)
    at org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2840)
    at org.apache.camel.impl.DefaultCamelContext.doStop(DefaultCamelContext.java:2675)
    at org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:102)
    at org.apache.camel.blueprint.BlueprintCamelContext.destroy(BlueprintCamelContext.java:122)
...

Environment

  • JBoss Fuse
    • 6.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content