6. Building and Running the Spring BlazeDS Integration Samples

6.1. Introduction

Included in the project distribution is a collection of samples called the Spring BlazeDS Integration Test Drive. This samples project is set up to be built with Maven and then imported into Eclipse for running the application via WTP.

Building the Test Drive

The sample build requires Maven 2.0.9 or greater. Because the build compiles several seperate Flex and AIR projects, it can require setting the MAVEN_OPTS variable for your environment to allocate more memory than the default. The setting we find works well is:

MAVEN_OPTS="-Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m"


Once your Maven environment is set up correctly, cd to {project distribution root}/spring-flex-samples/spring-flex-testdrive and execute:

mvn clean install


This will first build all of the individual Flex projects and then finally assemble the 'testdrive' WAR project.

Building the Test Drive to use Spring 3 and Spring Security 3

As of release 1.0.2 of Spring BlazeDS Integration, the Test Drive's Maven build includes an additional profile for building the samples to use Spring 3 and Spring Security 3. To build the samples using this profile, execute:

mvn clean install -P spring_3_0


Download the Pre-packaged Test Drive

As a convenience for anyone who is adverse to using Maven and just wants to get the Test Drive up and running quickly in Eclipse, pre-packaged builds of the Test Drive can be downloaded directly via the following links:

Unzip the download and then follow the directions below for importing into Eclipse, substituting the unzipped directory in place of the {project distribution root}/spring-flex-samples/spring-flex-testdrive path.

Importing and Running the Test Drive in Eclipse

The individual Test Drive projects are pre-configured to be imported in Eclipse and run with WTP. (There are a number of individual projects, so you may want to consider creating a fresh workspace or at least create a new working set to manage the projects.) We recommend using the free SpringSource Tool Suite to work with the samples so that you can take full advantage of its extensive Spring support, but any version of Eclipse 3.4+ with WTP should work.

To import the samples, select File->Import...->General->Existing Projects into Workspace and navigate to the {project distribution root}/spring-flex-samples/spring-flex-testdrive directory and import all of the projects found.

There is an individual project for each Flex sample, and one WTP project for the 'testdrive' WAR. Once the projects have been imported, you can start the web application by selecting the 'testdrive' project, right-clicking and selecting Run As->Run on Server. The samples have been most thoroughly tested in Tomcat 6.0, but should run in any Servlet 2.4 container that WTP supports. Once the application has started successfully, you can access the samples walk-through at http://localhost:8080/testdrive (If running on a server other than Tomcat, change the port number as needed.)