In Windows OS, mdb deployed in EAP 6.4 connecting to AMQ 6.3 with resource adapter fails intermittently with error - javax.naming.NameNotFoundException: ActiveMQConnectionFactory

Solution Verified - Updated -

Issue

We are using Jboss Fuse Container 6.3 for our modules. We are using ActiveMQ connector for interacting with queues. Issue we are facing is, when we are starting the Fuse container, services related to activeMQ are going to unknown state as there is delay for activeMQ.rar to start. So do we have any way to make ActiveMQ connector(activemq.rar) to start first and later the services related to activeMQ to start.

    10:47:24,634 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("deploy") failed - address: ([("deployment" => "example-camel-activemq-2.4.0.redhat-630329.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"example-camel-activemq-2.4.0.redhat-630329.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"example-camel-activemq-2.4.0.redhat-630329.war\".WeldStartService: Failed to start service
        Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
    Exception 0 :
    javax.enterprise.inject.InjectionException: Error adding routes of type [org.wildfly.camel.examples.activemq.ActiveMQRouteBuilder] to Camel context [camel-1]
            at org.apache.camel.cdi.CdiCamelExtension.addRouteToContext(CdiCamelExtension.java:405)
            at org.apache.camel.cdi.CdiCamelExtension.afterDeploymentValidation(CdiCamelExtension.java:354)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:45)
            at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
            at org.apache.camel.cdi.CdiCamelExtension$Proxy$_$$_WeldClientProxy.afterDeploymentValidation(CdiCamelExtension$Proxy$_$$_WeldClientProxy.java)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
            at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
            at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
            at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
            at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:164)
            at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
            at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
            at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:245)
            at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:233)
            at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213)
            at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:75)
            at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:46)
            at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:31)
            at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:382)
            at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980)
            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.RuntimeException: Error looking up java:/ActiveMQConnectionFactory in JNDI
            at org.jboss.weld.injection.spi.helpers.AbstractResourceServices.resolveResource(AbstractResourceServices.java:51)
            at org.jboss.weld.util.Beans.injectEEFields(Beans.java:731)
            at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:164)
            at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
            at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:161)
            at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:135)
            at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:157)
            at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:297)
            at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103)
            at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)
            at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
            at org.wildfly.camel.examples.activemq.ActiveMQRouteBuilder$Proxy$_$$_WeldClientProxy.addRoutesToCamelContext(ActiveMQRouteBuilder$Proxy$_$$_WeldClientProxy.java)
            at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:836)
            at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:833)
            at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2849)
            at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:833)
            at org.apache.camel.impl.DefaultCamelContext$Proxy$_$$_WeldClientProxy.addRoutes(DefaultCamelContext$Proxy$_$$_WeldClientProxy.java)
            at org.apache.camel.cdi.CdiCamelExtension.addRouteToContext(CdiCamelExtension.java:397)
            ... 32 more
    Caused by: javax.naming.NameNotFoundException: ActiveMQConnectionFactory -- service jboss.naming.context.java.ActiveMQConnectionFactory
            at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:104)
            at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)
            at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:243)
            at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)
            at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
            at javax.naming.InitialContext.lookup(InitialContext.java:417)
            at javax.naming.InitialContext.lookup(InitialContext.java:417)
            at org.jboss.weld.injection.spi.helpers.AbstractResourceServices.resolveResource(AbstractResourceServices.java:47)
            ... 49 more
    "}}

Environment

  • Red Hat Fuse on EAP
    • 6.3

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