5 Replies Latest reply on Aug 27, 2013 7:46 AM by aslak

    @Inject problem

    arnd

      Hi all,

       

      i have a simple stateless EJB which is a webservice:

       

      @Stateless

      @WebService

      public class TestBean {

      }

       

      and a simple Arqullian test:

       

      @RunWith(Arquillian.class)

      public class TestBeanIT {

       

          @Inject

          TestBean bean;

       

          @Deployment

          public static WebArchive createDeployment() {

              WebArchive arch =  ShrinkWrap.create(WebArchive.class);

              arch.addClass(TestBean.class);

              arch.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

              return arch;

          }

       

          @Test

          public void fooTest() throws Exception {

       

          }

      }

       

      Running the test i get the error "Unsatisfied dependencies for type [TestBean] with qualifiers [@Default] at injection point [[field] @Inject com.zimory.connect.accounting.dataservice.impl.TestBeanIT.bean]" in the deployment phase.

       

      The test runs if one of the annotations of TestBean is removed or if @Inject is replaced by @EJB.

       

      What is the problem here? I am using Arquillian 1.0.4.Final with a JBoss 7.1.1.

       

      Thank you in advance for any help,

      Arnd