Getting the examples

The examples are included as a WAR file in the binary distribution of Castor Taglibs here , and are also built as a part of the

Build all

Ant task.

You will certainly have to make some changes in either case in order to run the examples. In the instance of the WAR file you will need to decompress it with the JAR utility and make changes to the configuration files. In the case of building from source, all the configurations can be edited in the /etc directory. Details of the changes are in the sub-sections below.

Building the database

If you wish to use Ant to build the database, first create a blank database and a user with all permissions for that database. Next, edit the database target in the build.xml file to match your system (correct JDBC, driver, url, user, database and password). Once this is correct, type

build database

The database.sql file executed by this command is compatible with Postgres 7.3. You may need to change the SQL to make it work with your database.

Alternatively, simple execute the file in etc/sql/database.sql with your preferred RDBMS management utility.

Configuring the application

To run the application, you will need to change the following files.

domain.xml

You will need to change the JDBC XADatasource configuration to match your system. Refer to the Tyrex website for more information about configuring Tyrex.

database.xml

You will need to change the Castor database.xml configuration in etc/castor to use the correct datasource in your servlet container. Refer to the Castor documentation for more information.

mapping.xml

You may need to change the Castor mapping.xml if you are using a different RDBMS from Postgres 7.2. Note that the example uses PostgreSQl sequences to generate identity fields, and this is not supported by other RDBMS. Refer to the Castor documentation for more information.

server.xml

You may need to change the Tomcat server.xml if you

  • Wish to use a different datasource not configured within Tyrex or have changed the name of the datasource in the Tyrex domain.xml.
  • Wish to change any of the Castor JDO parameters.

Refer to the Tomcat documentation for more information.

web.xml

You should not need to change the Tomcat web.xml unless you changed the name of the Castor resource element in the server.xml above.

Refer to the Tomcat documentation for more information.