0 Replies Latest reply on Dec 1, 2014 10:49 AM by nicolas duminil

    Arquillian test won't work - JBAS011469

    nicolas duminil Master

      Hello,

       

      I'm running an arquillian test deployed on a EAP 6.3 managed container using the jboss-as-arquillian-container-managed 7.2.0.Final. It raises the following exception:

       

      javax.persistence.TransactionRequiredException: JBAS011469: La transaction doit effectuer cette opération (soit en utilisant une transaction, soit un contexte de persistance étendu)

          at org.jboss.as.jpa.container.AbstractEntityManager.transactionIsRequired(AbstractEntityManager.java:692)

          at org.jboss.as.jpa.container.AbstractEntityManager.persist(AbstractEntityManager.java:562)

          at myProject1.CustomerTest.test(CustomerTest.java:41)

      .....................

       

      The exception is saying: Transaction is required to perform this operation (either use a transaction or extended persistence context)


      Here is the code:


        @Test

        @Transactional

        public void test()

        {

          Customer customer = new Customer("firstName", "lastName");

          em.persist(customer);

      ......................

       

      What am I missing ?

       

      Many thanks in advance,

       

      Nicolas