Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Merging in more changes

...

To run Wookie in standalone mode:

cd PROJECT_HOME_DIRECTORY
ant run

The first time you run wookie (or compile it) any required libraries will be downloaded, this can take some time and requires a network connection.

...

If you want to start with a completely clean build then use:

cd PROJECT_HOME_DIRECTORY
ant clean-build run

Running options

...

The following will compile and run the server in Tomcat with a MySQL databasespecified RDBMS using JPA persistence. The database tables will be set up automaticallyschema can be defined and populated on launch, however you must have previously created a database called "widgetdb" with username "java" and password "java". (If you want to change the database connection settings, then you need to alter the default settings in "build.properties".)

Edit the "build.properties" file as follows:

  • uncomment "project.using.mysql=true" and comment out "project.using.derby=true"
  • set "servletEngine.webapp.dir=" to the location of your tomcat webapps directory.
  • set "widget.deploy.dir=" to the "deploy" folder of the deployed application, e.g. "tomcat/webapps/wookie/deploy"
  • set "servletEngine.container.lib.dir" and "servletEngine.context.conf.dir" as described in the comments in build.properties
  • complete the database connection details for your database starting from "wookie.persistence.manager.type", or simply uncomment to use the default MySQL database setup described above.

done the following:

1. Obtained a JDBC driver jar file for the database,
2. created an empty database for Wookie's persistent storage, and
3. have valid database credentials to access it.

Make the following changes to configure build.properties, (substituting CATALINA_HOME with the absolute or relative path to Tomcat's installation directory and specifying the database driver, url, type and credentials connection information):

widget.deploy.dir=CATALINA_HOME/webapps/wookie/deploy
servletEngine.webapp.dir=CATALINA_HOME/webapps
servletEngine.container.lib.dir=CATALINA_HOME/lib
servletEngine.context.conf.dir=CATALINA_HOME/conf/Catalina/localhost
wookie.persistence.manager.type=jpa
wookie.db.user=java
wookie.db.password=java
wookie.db.driver=com.mysql.jdbc.Driver
wookie.db.uri=jdbc:mysql://localhost:3306/widgetdb
wookie.db.type=mysql
jdbc.driver.path=../mysql-connector-java-5.1.7.jar

The wookie.db.type setting can accept the following values: db2, derby, hsqldb, mssql, mysql, mysql5, oracle, oracle9, oracle10, postgresql, and sybase. The jdbc.driver.path setting can be absolute or relative file path to the driver jar archive.

To ensure the configuration changes are propagated into the Wookie build artifacts, perform a full clean build after changing build.properties:

cd PROJECT_HOME_DIRECTORY
ant clean-build deploy-webapp

To force Wookie to define or reset the database schema on the first start, use the following commands to start the Tomcat server:

cd PROJECT_HOME_DIRECTORY
export CATALINA_OPTS="-Dwidget.persistence.manager.initstore=true"
CATALINA_HOME/bin/startup.sh

To shutdown the Wookie Tomcat server and clear the initialization flag:

cd PROJECT_HOME_DIRECTORY
CATALINA_HOME/bin/shutdown.sh
export CATALINA_OPTS=

There are also SQL scripts for all of the valid database configurations built as part of Wookie that can be used to initialize the database schema manually if desired. These are located here:

build/classes/org/apache/wookie/beans/jpa/db2-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/derby-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/hsqldb-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/mssql-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/mysql5-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/mysql-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/oracle10-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/oracle9-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/oracle-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/postgresql-wookie-schema.sql
build/classes/org/apache/wookie/beans/jpa/sybase-wookie-schema.sql

The Wookie server will populate the newly initialized database with seed data to complete the process when started.

You will need to create Create a user with the role "widgetadmin" in your tomcat installation. For example, add the following to tomcat-users.xml:

...

ant clean-build deploy-webapp

By default Wookie connects to MySQL using OpenJPA.

Once the server is running connect your debugger to port 8000. If "suspend=y" is used, it will will block, waiting for a debug connection before starting the server.

Running Wookie with a security manager

...