camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Moulliard (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-6937) BeanManager cannot be retrieved when camel cdi is deployed in Karaf
Date Thu, 07 Nov 2013 10:35:18 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-6937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13815830#comment-13815830
] 

Charles Moulliard commented on CAMEL-6937:
------------------------------------------

DeltaSpike is not able to retrieve a BeanManager/Container when project is deployed on OSGI
platform using Pax CDI

Solution is to inject BeanManager using @Observes annotation and use CDI classes/methods.
As Deltaspike BeanProvider is a wrapper class around CDI classes, this code (+ dependency)
is not required and can also work for Java SE

> BeanManager cannot be retrieved when camel cdi is deployed in Karaf
> -------------------------------------------------------------------
>
>                 Key: CAMEL-6937
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6937
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Charles Moulliard
>            Assignee: Charles Moulliard
>
> When Camel CDI is deployed in Karaf using Pax CDI 0.6.0-SNAPSHOT, Weld 2.0 & CDI
1.1 Spec then the camel cdi extension raises this exception as the BeanManager cannot retrieved
> Code must be refactorised :
> {code}
> Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
> Exception 0 :
> java.lang.IllegalStateException: No org.apache.deltaspike.core.api.provider.BeanManagerProvider
in place! Please ensure that you configured the CDI implementation of your choice properly.
If your setup is correct, please clear all caches and compiled artifacts.
> 	at org.apache.deltaspike.core.api.provider.BeanManagerProvider.getInstance(BeanManagerProvider.java:133)
> 	at org.apache.deltaspike.core.api.provider.BeanProvider.getBeanManager(BeanProvider.java:473)
> 	at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:117)
> 	at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:100)
> 	at org.apache.camel.cdi.internal.CamelExtension.getCamelContext(CamelExtension.java:331)
> 	at org.apache.camel.cdi.internal.CamelExtension.startConsumeBeans(CamelExtension.java:226)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Meat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
> 	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
> 	at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:119)
> 	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
> 	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
> 	at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
> 	at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:128)
> 	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:102)
> 	at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvva:63)
> 	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:429)
> 	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:81)
> 	at org.ops4j.pax.cdi.weld.impl.WeldCdiContainer.createBeanManager(WeldCdiContainer.java:114)
> 	at org.ops4j.pax.cdi.weld.impl.WeldCdiContainer.access$000(WeldCdiContainer.java:55)
> 	at org.ops4j.pax.cdi.weld.impl.WeldCdiContainer$1.call(WeldCdiContainer.java:93)
> 	at org.ops4j.pax.cdi.weld.impl.WeldCdiContainer$1.call(WeldCdiContainer.java:89)
> 	at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)
> 	at org.ops4j.pax.cdi.weld.impl.WeldCdiContainer.doStart(WeldCdiContainer.java:89)
> 	at org.ops4j.pax.cdi.spi.AbstractCdiContainer.start(AbstractCdiContainer.java:88)
> 	at org.ops4j.pax.cdi.extender.impl.CdiExtender.createContainer(CdiExtender.java:128)
> 	at org.ops4j.pax.cdi.extender.impl.CdiExtender.addingBundle(CdiExtender.java:86)
> 	at org.ops4j.pax.cdi.extender.impl.CdiExtender.addingBundle(CdiExtender.java:44)
> 	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:467)
> 	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:414)
> 	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
> 	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
> 	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443)
> 	at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:868)
> 	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
> 	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
> 	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403)
> 	at org.apache.felix.framework.Felix.startBundle(Felix.java:2092)
> 	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1291)
> 	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
> 	at java.lang.Thread.run(Thread.java:722)
> {code} 



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message