1 Reply Latest reply on Aug 29, 2013 8:26 AM by bmajsak

    Cannot include libraries and jar in  ear

    sarah333

      Hi all,

       

      I'm testing Java persistencein an embedded glassfish. I followed the tutorial http://arquillian.org/guides/testing_java_persistence/  and every thing worked till i change the deployment method. In fact, in that example they produce a war but i need to produce an ear that contains the following element :

       

       

      myproject-ear

                           -myproject.jar

                           -lib (that should contain all the librairies jars)

                           -META-INF

                                            - application.xml

                                            - sun-application.xml

       

       

       

      Here is my code of deployment:

       

      @Deployment

          public static Archive<?> createDeployment()

       

              final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "arquillian-tests.jar")

                      .addPackage(Account.class.getPackage())

                      .addClasses(

                              Account.class,                      

                             

                              ....       

       

                      )

                      .addAsResource("test-persistence.xml", "META-INF/persistence.xml")

                      ;

       

              final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class,

                      "arquillian-tests.ear")            

                      .addAsModule(ejb);

       

              return ear;

       

       

          }

       

      But when running my tests ,they fail.

       

      Any idea ??