2 Replies Latest reply on May 8, 2007 4:24 PM by bill.burke

    Deployment into embedded container

    estiedi

      Why do the examples use such a cumbersome way to deploy the archive?

       private static void deploy()
       {
       jar = AssembledContextFactory.getInstance().create("ejbTestCase.jar");
       jar.addClass(Customer.class);
       jar.addClass(CustomerDAOBean.class);
       jar.addClass(CustomerDAOLocal.class);
       jar.addClass(CustomerDAORemote.class);
       jar.mkdir("META-INF").addResource("tutorial-persistence.xml", "persistence.xml");
       try
       {
       Bootstrap.getInstance().deploy(jar);
       }
       catch (DeploymentException e)
       {
       throw new RuntimeException("Unable to deploy", e);
       }
       }
      


      I copy the jar file under test to the deploy dir in my ant script. That seems to work well and IMO is much simpler.
      Furthermore I'm afraid it might endanger the reliablility of your tests if the distributed jar differs from the jar you build inside the test.


        • 1. Re: Deployment into embedded container
          skomarla

          I think the answer is that this example is illustrating a runtime deployment of a bean. You can certainly use the jar file in the folder mechanism as well.

          Since this is an embedded jboss, the assumption is that you want my finer grained control of the jboss environment. Actually, I will be making heavy use of the virtual jar deployment in my project

          • 2. Re: Deployment into embedded container
            bill.burke

            Yes, the "virtual archive" capability is an option. Its pretty useful in IDE environments where you want to do unit testing, but don't want to bother (or you can't) create the jars.