0 Replies Latest reply on Jul 24, 2013 9:21 AM by sarah Aldhen

    Producing EnterpriseArchive that contains WebArchive and JavaArchive

    sarah Aldhen Newbie

      I want to produce an ear that contain a two archives ejb and war.      While excuting my code I get an exception . here is my code.

       

      @Deployment

          public static Archive<?> createDeployment() {

       

       

              final WebArchive war = ShrinkWrap.create(WebArchive.class, "arquillian-tests.war")

                      .addAsWebInfResource("WEB-INF/sun-web.xml")

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

       

       

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

                      .addPackage(Account.class.getPackage())

                      .addClasses(

                              Account.class,                       

                              UserBean.class,

                              ....        

       

                      )

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

                      ;

       

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

                      "arquillian-tests.ear")

                      .addAsModule(war)

                      .addAsModule(ejb);

       

       

              return ear;

       

       

          }

      Am I doing something wrong ???