Downloading Wookie
Wookie is designed to be downloaded using subversion; to checkout the latest code:
svn co http://svn.apache.org/repos/asf/incubator/wookie/trunk
If you are a committer you should use https:// rather than http://
This will downloaded the latest source code to your current folder. You then need to enter:
cd PROJECT_HOME_DIRECTORY
ant
The first time you run this command all dependencies will be downloaded so you must be online and it will take some time. Subsequent builds will be much faster.
You can run Wookie in a number of different configurations, as described in the following sections.
Configuring your IDE
Wookie use Apache Ivy to resolve dependencies, you will therefore need the IvyDE plugin available at http://ant.apache.org/ivy/ivyde/index.html.
Running Wookie in "standalone" mode
The quickest way to run Wookie is in "standalone" mode; in this mode Wookie uses a local database and embedded server. This is a good way to experiment with Wookie in development.
To run Wookie in standalone mode:
ant clean-db 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.
The "clean-db" target ensures that your development environment starts in a consistent state. However, any modifications you have made to the database during previous runs will be lost. To run the development server without cleaning the database you need to set initDB=false
. See the next section for more details.
Once the server is running go to http://localhost:8080/wookie
To access the administration menu (http://localhost:8080/wookie/admin) use the username 'java' and password 'java'.
If you want to start with a completely clean build then use:
ant clean-build clean-db run
Running options
To set run mode options you can either add properties to the local.build.properties
file or you can pass properties in via the command line using -Drun.args="<property_name>=<property_value> <property_name>=<property_value>"
. For example:
-Drun.args="port=8080 initDB=false"
Available properties are:
Property |
Values |
Description |
Default |
---|---|---|---|
initDB |
True or False |
Initialise the DB to a default configuration |
True |
port |
Integer |
Set the port on which the server is to run |
8888 |
Running Wookie in debug mode
You can start Wookie in debug mode using JDSPA with the following command:
ant -Djvmargs="-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n" run
Running Wookie with Tomcat and MySQL
The following will compile and run the server in Tomcat with a MySQL database. The database tables will be set up automatically, 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 scripts/mysql/hibernate.cfg.xml.)
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.
Create a user with the role "widgetadmin" in your tomcat installation. For example, add the following to tomcat-users.xml:
<role rolename="widgetadmin"/>
<user username="java" password="java" roles="widgetadmin"/>
If you have previously used Wookie in standalone deployment, to ensure the right scripts are included in the build you need to run:
ant clean-build
Then to build and deploy the webapp, run:
ant deploy-webapp
Once Wookie is deployed, you can setup the MySQL tables by running:
ant clean-db
You can then start Tomcat as usual.
To access the administration menu (http://localhost:8080/wookie/admin) use the username 'java' and password 'java'.
If you want to start with a completely clean build then use:
ant clean-build deploy-webapp
If you want to clean the database use:
ant clean-db
By default Wookie connects to MySQL using Hibernate and the C3P0 connection pooler.
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 other configurations
Other configurations of Wookie can also be run; the main requirements are a servlet container and a database. The setup information for databases can be found in the /scripts directory. How these are loaded into configurations is defined in build.xml; the main requirement is to define connection details in scripts/database/hibernate.cfg.xml and to define the database setup script in scripts/database/widgetdb.sql.
The deploy-webapp task can be used to deploy Wookie to any servlet container application.