Accessibility

Table of Contents

Adobe Flex, BlazeDS, and Hibernate JPA on Tomcat and MySQL — Part 1: Putting it all together in a simple demo application

Preparing the development environment

To set up your development environment, begin by starting Flex Builder 3. When the Workspace Launcher dialog box appears (see Figure 2), enter the directory to use for your workspace. For example:

C:\ADC\Workspace

The Workspace Launcher

Figure 2: The Workspace Launcher

If the Welcome page (see Figure 3) is open when Flex Builder starts, close it and go to the workbench.

The Flex Builder welcome page

Figure 3: The Flex Builder welcome page

Optionally update the JRE

As an optional step, you can update the Java Runtime Environment (JRE) to the most recent version. This is not a necessary step; Adobe Flex Builder ships with JRE 1.5.0_11, which will work just as well with the sample application. To do this in Flex Builder, follow these steps:

  1. Choose Window > Preferences. On the left hand side of the Preferences dialog box click Java and then Installed JREs. Click Add to add a new JRE (see Figure 4).

    Installed JREs

    Figure 4: Installed JREs

  2. Select Standard VM and click Next (see Figure 5).

    Selecting the JRE Type

    Figure 5: Selecting the JRE Type

  3. Click on Directory and browse to the desired JRE directory (see Figure 6).

    Add JRE Dialog

    Figure 6: Add JRE Dialog

  4. Select the checkbox in front of the newly added JRE and click OK, then click OK again to close the Preferences dialog box (see Figure 7).

    The newly installed JRE

    Figure 7: The newly installed JRE

Create the server runtime environment in Eclipse

It helps to create the server runtime before you create the actual project so that you are prepared when the New Project wizard asks you to select a server. Choose Window > Preferences. Next, on the left hand side of the Preferences dialog box click Server then Runtime Environments. Click Add to add a new runtime (see Figure 8).

Server Runtime Environments

Figure 8: Server Runtime Environments

Expand Apache, select Apache Tomcat v6.0, and click Next (see Figure 9).

New Server Runtime Environment

Figure 9: New Server Runtime Environment

Click Browse, browse to the extracted Tomcat directory (in this case, c:\ADC\apache-tomcat-6.0.18), and then click Finish (see Figure 10).

New Tomcat Server

Figure 10: New Tomcat Server

Click OK to close the Preferences dialog box.

Create the server

To create a new server, right-click in the Servers view of the Java EE perspective and select New > Server. In the New Server dialog box, select Apache Tomcat v6.0 Server and click Next (see Figure 11).

Define the Tomcat Server

Figure 11: Define the Tomcat Server

For now, do not add or remove any projects (see Figure 12). You will add the Web application to the Tomcat server later. Click Finish.

Do not add add and remove projects in
this step.

Figure 12: Do not add add and remove projects in this step.