5 Replies Latest reply on Sep 9, 2011 3:13 PM by aslak

    Public static class as EJB not recognized by Arq/JBoss 7

    pedrokowalski

      Howdy Guys!

       

      It seems that Arquillian is not able to access EJB's defined as a static classes. What I mean is if you have the following part of the Arquillian test:

       

      @RunWith(Arquillian.class)
      public class GenericCrudBeanIT {
      
          @EJB
          TestingCRUDBean cut;
      

       

      and assuming that TestingCRUDBean is defined as follows:

       

      @Stateless
      @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
      public class TransactionalBean {
      
          public void call(Callable<?> toInvoke) throws Exception {
              toInvoke.call();
          }
      
          @Stateless
          public static class TestingCRUDBean extends GenericCrudBean<Long, TestingEntity> {
      
          }
      }
      

      Arquillian will see 'null' as a value of 'cut' variable. However, if the TestingCRUDBean will be set as a separate class in it's own file - it works fine.

       

      I think that EJB's defined as public static inner classes should be recognized and injected properly, as they are properly resolved when deployed directly in AS 7 or GF-3.1.1.

       

      WDYT?

       

      Cheers!