Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-13799

camel-cdi: Remove support for multiple context via @ContextName (was: NPE with recent camel-cdi changes)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0.RC1, 3.0.0
    • camel-cdi
    • None
    • Unknown

    Description

      Exception 0 :
      javax.enterprise.inject.InjectionException: Error adding routes of type [org.wildfly.camel.test.cdi.subA.RouteBuilderB] to Camel context [contextB]
      	at org.apache.camel.cdi.CdiCamelExtension.addRouteToContext(CdiCamelExtension.java:467)
      	at org.apache.camel.cdi.CdiCamelExtension.afterDeploymentValidation(CdiCamelExtension.java:410)
      	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.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
      	at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:187)
      	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
      	at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:123)
      	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
      	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
      	at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
      	at org.jboss.weld.util.Observers.notify(Observers.java:166)
      	at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
      	at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
      	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:177)
      	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:171)
      	at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
      	at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
      	at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
      	at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:505)
      	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:93)
      	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:98)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1737)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1699)
      	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1557)
      	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.enterprise.inject.InjectionException: Camel annotations post processing of [InjectionTarget for Managed Bean [class org.wildfly.camel.test.cdi.subA.RouteBuilderB] with qualifiers [@Any @ContextName]] failed!
      	at org.apache.camel.cdi.CamelBeanInjectionTarget.inject(CamelBeanInjectionTarget.java:44)
      	at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:161)
      	at org.jboss.weld.contexts.unbound.DependentContextImpl.get(DependentContextImpl.java:70)
      	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
      	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:694)
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:717)
      	at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
      	at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:87)
      	at org.apache.camel.cdi.BeanManagerHelper.getReference(BeanManagerHelper.java:53)
      	at org.apache.camel.cdi.CdiCamelExtension.addRouteToContext(CdiCamelExtension.java:452)
      	... 31 more
      Caused by: java.lang.NullPointerException
      	at org.apache.camel.support.CamelContextHelper.getEndpointInjection(CamelContextHelper.java:187)
      	at org.apache.camel.impl.engine.CamelPostProcessorHelper.doGetEndpointInjection(CamelPostProcessorHelper.java:160)
      	at org.apache.camel.impl.engine.CamelPostProcessorHelper.getEndpointInjection(CamelPostProcessorHelper.java:150)
      	at org.apache.camel.impl.engine.CamelPostProcessorHelper.getInjectionValue(CamelPostProcessorHelper.java:228)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:210)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:204)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.lambda$injectFields$0(DefaultCamelBeanPostProcessor.java:181)
      	at org.apache.camel.util.ReflectionHelper.doWithFields(ReflectionHelper.java:108)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.injectFields(DefaultCamelBeanPostProcessor.java:166)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:91)
      	at org.apache.camel.cdi.CamelBeanInjectionTarget.inject(CamelBeanInjectionTarget.java:41)
      	... 41 more
      Exception 1 :
      javax.enterprise.inject.InjectionException: Error adding routes of type [org.wildfly.camel.test.cdi.subA.RouteBuilderA] to Camel context [contextA]
      	at org.apache.camel.cdi.CdiCamelExtension.addRouteToContext(CdiCamelExtension.java:467)
      	at org.apache.camel.cdi.CdiCamelExtension.afterDeploymentValidation(CdiCamelExtension.java:410)
      	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.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
      	at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:187)
      	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
      	at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:123)
      	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
      	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
      	at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
      	at org.jboss.weld.util.Observers.notify(Observers.java:166)
      	at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
      	at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
      	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:177)
      	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:171)
      	at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
      	at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
      	at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
      	at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:505)
      	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:93)
      	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:98)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1737)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1699)
      	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1557)
      	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.enterprise.inject.InjectionException: Camel annotations post processing of [InjectionTarget for Managed Bean [class org.wildfly.camel.test.cdi.subA.RouteBuilderA] with qualifiers [@Any @ContextName]] failed!
      	at org.apache.camel.cdi.CamelBeanInjectionTarget.inject(CamelBeanInjectionTarget.java:44)
      	at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:161)
      	at org.jboss.weld.contexts.unbound.DependentContextImpl.get(DependentContextImpl.java:70)
      	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
      	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:694)
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:717)
      	at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
      	at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:87)
      	at org.apache.camel.cdi.BeanManagerHelper.getReference(BeanManagerHelper.java:53)
      	at org.apache.camel.cdi.CdiCamelExtension.addRouteToContext(CdiCamelExtension.java:452)
      	... 31 more
      Caused by: java.lang.NullPointerException
      	at org.apache.camel.support.CamelContextHelper.getEndpointInjection(CamelContextHelper.java:187)
      	at org.apache.camel.impl.engine.CamelPostProcessorHelper.doGetEndpointInjection(CamelPostProcessorHelper.java:160)
      	at org.apache.camel.impl.engine.CamelPostProcessorHelper.getEndpointInjection(CamelPostProcessorHelper.java:150)
      	at org.apache.camel.impl.engine.CamelPostProcessorHelper.getInjectionValue(CamelPostProcessorHelper.java:228)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:210)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.injectField(DefaultCamelBeanPostProcessor.java:204)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.lambda$injectFields$0(DefaultCamelBeanPostProcessor.java:181)
      	at org.apache.camel.util.ReflectionHelper.doWithFields(ReflectionHelper.java:108)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.injectFields(DefaultCamelBeanPostProcessor.java:166)
      	at org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:91)
      	at org.apache.camel.cdi.CamelBeanInjectionTarget.inject(CamelBeanInjectionTarget.java:41)
      	... 41 more
      "}}}}
      

      CrossRef: https://github.com/wildfly-extras/wildfly-camel/issues/2859

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              tdiesler Thomas Diesler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: