Version 1

    I'm new to Arquillian,

    but I managed finally to write tests succesfully that work with a embedded glassfish 3.1 and test my JPA-Methods from entities (namedQueries so far) with its derby-Database. CDI of Entitymanager and UserTranscation works fine.



        private EntityManager em;



        UserTransaction utx;


    Now I wanted to test my namedQueries with my real server: Glassfish 4.1 and Arquillian 1.1.11.Final.

    My Project declared BeanDiscoveryMode as All and I it works to the point, that I want inject a EntityManager.

    I get following Exception:

    java.lang.RuntimeException: Could not inject members

      at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectClass(

      at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.enrich(

      at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(

      at java.lang.reflect.Method.invoke(

    My simple Test looks like this:


    public class MitarbeiterTestRemote {


        private EntityManager em;



        public static JavaArchive createDeployment() {

            return ShrinkWrap.create(JavaArchive.class, "test.jar")


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




        public void testMethode() {

            Assert.assertTrue(1 < 5);



    Did I miss to change something important, so that my injection can work? Do you need other information to help me with this problem?


    Thanks so far.