There are two ways to use Barracuda:
If you just want to use Barracuda within your webapp, all you
need to do is copy the appropriate jars into your webapp (and possibly
your appserver). While there are a number of possibilities (and the
details may vary depending on you appserver), here's a typical setup for
Tomcat 4.x/5.x:
First, run ant jars.master to generate a single unified barracuda.jar (or download it from the latest binary release). Next, put the following jars in these locations:
If you want to actually install the Barracuda project locally (to run the samples, see the Barracuda docs, etc), you will need
to get Barracuda,
compile it, and then setup your
local appserver (eg. Tomcat 5.x) to point to the /Barracuda2 root
directory. There are several ways to do this.
OPT 1 - it may be easiest to go to <CATALINA_HOME>\conf\Catalina\localhost
and create a Barracuda.xml that looks something like this:
<Context docBase="D:/svnroot/Barracuda2" path="/Barracuda">
</Context>
Now all you have to do is cycle Tomcat and Barracuda should automatically be running as a webapp. You should be able to see it listed through the Tomcat admin interface, and you should be able to access it at http://localhost:8080/Barracuda/.
OPT 2 - alternately, you may generate a .war file using "ant war" and copy the .war file into the directories specified above in the first option
Note: if you are using Tomcat 4.1, the directory will be CATALINA_HOME/webappsOPT 3 - use the Catalina Ant manager tasks which use the Ant build to deploy Barracuda. This involves a number of initial steps to set up, but is recommended because it makes things much more flexible and convenient...
- configure manager application access
- create a file called ".build.properties" in USER_HOME. For example, here is my path to USER_HOME under Win2k: "C:\Documents and Settings\jkjome". Note that under Windows, you will have to use the command line to create this file because Windows Explorer won't allow the creation of files prefixed with non-alphnumeric characters. This file will override Barracuda's local Barracuda/src/build.properties file when running Ant. Add the username/password combo you configured in the last step to the properties "manager.username" and "manager.password", respectively, in the ".build.properties" file.
- Make sure Tomcat has been restarted since the time your performed step #1
You can now cd to Barracuda/WEB-INF/bin and type "ant catalina-install". This will install the Barracuda webapp into Tomcat's memory. Access it at http://localhost:8080/Barracuda. You can access the GUI for the manager app by visiting http://localhost:8080/manager/html/list
There are actually a few ways to install/deploy Barracuda to Tomcat as well as manipulate the running context and query it for information. Certain tasks are paired and shouldn't be intermixed (catalina-install/catalina-remove and catalina-deploy/catalina-undeploy). Here are the Catalina Ant Manager targets (named for their tasks) and descriptions of their functionality...
- catalina-install/catalina-remove - These targets install and remove a context. An install is not persistent across server restarts. The context is installed from wherever it sits on the file system. Nothing is uploaded to Tomcat. These targets are nice to use for testing or demo'ing.
- catalina-deploy/catalina-undeploy - These targets deploy and undeploy a context. A deploy is persistent across server restarts. The context is uploaded to Tomcat in a .war archive. In fact, the context is served directly out of the .war archive instead of off the filesystem. Additionally, Tomcat's server.xml will be rewritten to record the context's existence and, thus, provide persistence across server restarts. This is a more heavyweight way to deploy webapps, but necessary for production deployment.
- catalina-reload - This target reloads the context and can be used no matter the method used to install/deploy the webapp. Note that changes to the web.xml will not be picked up using this target, but classes will be reloaded.
- catalina-start/catalina-stop - Like the catalina-reload target, these targets can be used no matter the method used to install/deploy the webapp. Unlike catlina-reload, however, changes to the web.xml will be picked up in a start/stop cycle.
- catalina-list - This target lists the current webapps installed/deployed currently on the server
- catalina-roles - This target lists all available user roles, not just those of the current authenticated user. I don't use this much.
- catalina-resources - list global JNDI resources of a particular fully qualified class. I don't use this much.
Also available are a few convenience targets...
For more information, see the Manager app howto and the HTML Manager app howto. Additionally, see the Barracuda contrib package howto for information about using the Catalina Ant Manager tasks in conjunction with the contrib apps, making them a cinch to install/deploy under Tomcat.
- catalina-reinstall - calls catalina-remove, then catalina-install
- catalina-redeploy - calls catalina-undeploy, then catalina-deploy
- catalina-restart - calls catalina-stop, then catalina-start. Note that this is very similar to catalina-reload except that catalina-reload won't re-read the web.xml.