The instructions below explain how to install into the Eclipse IDE (or equivalent, such as Spring Source Tool Suite). You can adapt these instructions to work with different IDEs.
Install OpenXava and verify operation
and verify that the installed sample executes, using OpenXava instructions.
Download the BusLogicDemoOpenXava project, and expand the zip. We suggest you place it inside the OpenXava installation (parallel to Tomcat and the Workspace).
This contains the prerequisites for the application, including the hsql database and jdbc drivers, hibernate, etc. We do recommend you separately download the full Automated Business Logic install, although that is not required to run this demo.
BusLogicDemoOpenXava is delivered as a zipped project you can import as described below.
Import Project into OpenXava workspace
BusLogicDemoOpenXava.zip into the OpenXava
workspace folder, and expand it as shown below.
Now import the project into Eclipse, as follows:
- Open Eclipse, specifying the
workspace folder shown above
- From the Eclipse File > Import > Existing Project, and select the
BusLogicDemoOpenXava folder located inside the workspace folder
Use Project > Clean to rebuild all the class and properties files.
Most of the configuration has been supplied in the imported project. However, you must still perform the steps outlined in the sub-sections below. Use the screen shot below as a reference.
Access Servers View (add it via Window > Show View if it is not already present), and right click in the view for New > Add Server; in the ensuing wizards:
- Define a New Server
- Server Type:
- Server Name -- default is fine:
Tomcat v6.0 Server at localhost
- Click Next
- Tomcat Server - Specify the installation directory
- Select the Tomcat supplied in the OpenXava install (parallel folder to the workspace)
- Add and Remove
- Add BusLogicDemoOpenXava to the server
- Click Finish
Configure the Tomcat Data Source: context.xml in Servers project
In the Servers project in your workspace, edit the URL in the
context.xml file (see diagram above) to indicate the location of your
BusLogicIntroOpenXava/data folder (or, copy this to a desired location).
Note: On Windows, consider using the
As an alternative to the Quick Installation above, you can manually create the BusLogicDemoOpenXava project, using OpenXava guidelines for running under Eclipse (click the book, and please refer to Chapter 4).
Verify that your project is running
- Start the server (Server View - select Tomcat V6.0 OX, right click and execute Debug)
- Set a breakpoint in CustomerLogic (line 11)
- Run the application using http://localhost:8080/BusLogicDemoOpenXava/modules/Customer
- You won't see much in the Debugger Variables panel, since the logic is specified in the annotation, not a Java method
- Alternatively, you can specify Constraints using Java or Groovy methods, which you may find easier to debug:
- This approach will also require an Instance Variable
- Such instance variables contain valuable debug information
- Navigate to the first Order, and alter the Paid flag
- Verify the breakpoint is hit