0 Replies Latest reply on Mar 31, 2014 7:14 AM by Adam Wyłuda

    Exception in ManagedBean.getUnboundRequestContext() with infinispan-cdi

    Adam Wyłuda Newbie

      Hello, I'm trying to integrate Infinispan CDI with JBoss Forge, however I get following errors during Weld initialization.

      The version of Infinispan I use is 6.0.2.Final, CDI provider is Weld 2.0.4.Final, full source code of my project is available at adamwy/addon-cache · GitHub

      I'd be glad if someone could help me to fix it.

       

      org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
      Exception 0 :
      org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456 Argument bean must not be null
        at org.jboss.weld.util.Preconditions.checkArgumentNotNull(Preconditions.java:40)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:756)
        at org.jboss.weld.bean.ManagedBean.getUnboundRequestContext(ManagedBean.java:272)
        at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:167)
        at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:742)
        at org.jboss.weld.event.ObserverMethodImpl.getReceiver(ObserverMethodImpl.java:302)
        at org.jboss.weld.event.ObserverMethodImpl.getReceiverIfExists(ObserverMethodImpl.java:295)
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:259)
        at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:240)
        at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:171)
        at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:167)
        at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:121)
        at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:114)
        at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:673)
        at org.jboss.weld.util.ForwardingBeanManager.fireEvent(ForwardingBeanManager.java:101)
        at org.infinispan.cdi.util.defaultbean.DefaultBeanExtension.fireBeanInstalledEvent(DefaultBeanExtension.java:422)
        at org.infinispan.cdi.util.defaultbean.DefaultBeanExtension.afterBeanDiscovery(DefaultBeanExtension.java:399)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:274)
        at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:261)
        at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:240)
        at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:171)
        at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:130)
        at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:104)
        at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
        at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
        at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:58)
        at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:517)
        at org.jboss.weld.bootstrap.api.helpers.ForwardingBootstrap.deployBeans(ForwardingBootstrap.java:63)
        at org.jboss.weld.environment.se.Weld.initialize(Weld.java:143)
        at org.jboss.forge.furnace.container.cdi.lifecycle.WeldAddonLifecycleProvider.start(WeldAddonLifecycleProvider.java:67)
        at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:91)
        at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:85)
        at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
        at org.jboss.forge.furnace.impl.addons.AddonRunnable.run(AddonRunnable.java:84)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
      
      
        at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:37)
        at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:58)
        at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:517)
        at org.jboss.weld.bootstrap.api.helpers.ForwardingBootstrap.deployBeans(ForwardingBootstrap.java:63)
        at org.jboss.weld.environment.se.Weld.initialize(Weld.java:143)
        at org.jboss.forge.furnace.container.cdi.lifecycle.WeldAddonLifecycleProvider.start(WeldAddonLifecycleProvider.java:67)
        at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:91)
        at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:85)
        at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
        at org.jboss.forge.furnace.impl.addons.AddonRunnable.run(AddonRunnable.java:84)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
      

       

      When I debugged it I noticed that beanManager.getBeans(RequestContext.class, UnboundLiteral.INSTANCE)  in ManagedBean.getUnboundRequestContext(ManagedBean.java:270) returns empty collection and is responsible for the error.