Version 6
    Introduction

    This document serves as guide for the QuickStart examples using the Embedded APIs for JBoss Application Server.  These come as a slim Mavenized project containing a simple EJB3 Stateless Session Bean, Integration Test, and POM configuration needed to run the full suite.  The source (which may be used as an initial working template) is available from:

     

    http://anonsvn.jboss.org/repos/jbossas/projects/embedded/examples/tags/

     

    Each tag will correspond with a release version of JBossAS.  These are:

     

     

    Downloading and Building

    Prerequisites

    • The environment variable JAVA_HOME set to a JDK6 installation
    • Apache Maven installed and available on the system PATH
    • Subversion installed and available on the system PATH

     

    Instructions

    1. Check out the desired target, for example:
      svn co http://anonsvn.jboss.org/repos/jbossas/projects/embedded/examples/tags/6.0.0.20100429-M3/
    2. Execute the Maven lifecycle to run the tests
      mvn clean integration-test

     

    As an alternative to checking out from subversion, you may grab the latest sources as published from our Nexus repository.

     

    What's Happening

     

    The POM in the example has been configured to automate a few things for us:

    1. Create a dependency upon every runtime library present in the AS runtime.  This ensures that parent>child delegation within the ClassLoading model will take over, and all AS libraries including the EJB3, JCA, and Microcontainer APIs are available for use directly in the test class.  This dependency is created by the mechanism detailed in the article JBoss Embedded AS | Full ClassPath via Maven .  In the future we may make available an isolated ClassLoader which will enable users to get much finer control over where classes are loaded from, despite what Maven puts on the application CL.
    2. Download and install from your local Maven repository the JBoss Application Server into ${projectHome}/target.  This is done in the "pre-integration-test" phase, and is a convenience that requires no explicit prior installation of the AS distribution.  Because this is a vanilla (default) install, you may want to add additional hooks to customize configuration files, etc.
    3. Runs the test with a Surefire config that sets required system properties and JVM parameters.  Typically this involves increasing the heap and permen size, setting the JBoss Log manager, and Java Endorsed directories.

     

    Porting this example to run from the IDE

     

    Embedded APIs for JBossAS may run from the JUnit / TestNG Runners in the IDE, provided you create a run configuration that uses the appropriate system properties and JVM launch parameters also found in the Surefire configuration within the example POM.