5 Replies Latest reply on Aug 25, 2014 7:10 AM by Juraj Húska

    Unable to inject member...

    Massimiliano Ziccardi Newbie

      I have a problem using Arquillian with Wildfly 8.1+JBOSGI 2.2.0.

       

      The test is very simple. I have a variable declared this way:

       

      @Inject

      public Bundle bundle;

       

      And a test like this:

      @Test

        public void testBundleInjection() throws Exception {

        // Assert that the bundle is injected

        Assert.assertNotNull("Bundle injected", bundle);

      }

       

      The assert always fails and, in the log, I see the following error:

      java.lang.RuntimeException: Could not inject members

        at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectClass(CDIInjectionEnricher.java:135)

        at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.enrich(CDIInjectionEnricher.java:78)

        at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:52)

      ...

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

        at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:102)

      ...

      Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001408: Unsatisfied dependencies for type Bundle with qualifiers @Default

        at injection point [BackedAnnotatedField] @Inject public com.primeur.astk.framework.ArquillianTestBundleInjection.bundle

        at mypackage.ArquillianTestBundleInjection.bundle(ArquillianTestBundleInjection.java:0)

      ...

        at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:83)

        at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:69)

        at org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1061)

        at org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201)

        at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectNonContextualInstance(CDIInjectionEnricher.java:143)

        at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectClass(CDIInjectionEnricher.java:125)

        ... 82 more

      Caused by: org.jboss.arquillian.test.spi.ArquillianProxyException: org.jboss.weld.exceptions.DeploymentException : WELD-001408: Unsatisfied dependencies for type Bundle with qualifiers @Default

        at injection point [BackedAnnotatedField] @Inject public com.primeur.astk.framework.ArquillianTestBundleInjection.bundle

        at com.primeur.astk.framework.ArquillianTestBundleInjection.bundle(ArquillianTestBundleInjection.java:0)

      [Proxied because : Original exception caused: class java.lang.NoClassDefFoundError: javax/enterprise/inject/spi/DeploymentException]

        at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:368)

        at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:289)

        at org.jboss.weld.bootstrap.Validator.validateProducer(Validator.java:426)

        at org.jboss.weld.injection.producer.InjectionTargetService.validateProducer(InjectionTargetService.java:35)

        at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:80)

        ... 87 more

       

       

      Do you have any idea/hint ?

       

      Thanks,

      Massimiliano