This document describes how to deploy the TreeBASE web application to a Tomcat servlet container.
Before deployment, ensure you have:
- Built the WAR file - Follow the instructions in BUILDING.md
- PostgreSQL database - Running and populated with data
- Tomcat 7 or later - Servlet container installed
- Headless Mesquite - For phylogenetic tree processing
- Apple JARs - Required by Mesquite (even on non-Mac platforms):
MRJToolkit.jarui.jar
For the Naturalis deployment, artifacts are managed in the treebase-artifact repository:
sudo su
cd /usr/local/src
git clone https://github.com/naturalis/treebase-artifactThis provides:
- WAR files in
/usr/local/src/treebase-artifact/ - Apple JARs in
/usr/local/src/treebase-artifact/mesquite/apple/ - Headless Mesquite in
/usr/local/src/treebase-artifact/mesquite/
Copy the WAR files to Tomcat's webapps directory:
Ubuntu 16.04 LTS with Tomcat 7:
cp /usr/local/src/treebase-artifact/treebase-web.war /var/lib/tomcat7/webapps/
cp /usr/local/src/treebase-artifact/data_provider_web.war /var/lib/tomcat7/webapps/Place the PostgreSQL JDBC driver in Tomcat's lib directory:
cd /usr/share/tomcat7/lib
wget https://jdbc.postgresql.org/download/postgresql-42.1.3.jarTreeBASE requires specific JVM arguments for proper operation:
- Apple JARs in classpath - For Mesquite support
- Increased memory - Changed from
-Xmx128mto-Xmx512m - JSP construct compatibility -
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=truefor Tomcat 7
TOM=/usr/share/tomcat7/bin
APPLE=/usr/local/src/treebase-artifact/mesquite/apple
/usr/lib/jvm/default-java/bin/java \
-Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties \
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
-Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC \
-Djava.endorsed.dirs=/usr/share/tomcat7/endorsed \
-classpath $TOM/bootstrap.jar:$TOM/tomcat-juli.jar:$APPLE/MRJToolkit.jar:$APPLE/ui.jar \
-Dcatalina.base=/var/lib/tomcat7 \
-Dcatalina.home=/usr/share/tomcat7 \
-Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp \
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true \
org.apache.catalina.startup.Bootstrap startAfter deployment, verify the application is running:
- Check Tomcat logs for startup errors
- Access the web interface at
http://your-server/treebase-web - Test the OAI-PMH interface at
http://your-server/data_provider_web
TreeBASE uses DWR for AJAX functionality including:
- Person email autocomplete
- Software/journal name autocomplete
- Algorithm suggestions
- File upload progress tracking
DWR is configured to work with Spring 5 using a custom compatibility wrapper. For details, see the Technical Notes.
WAR not expanding:
- Check Tomcat permissions
- Verify sufficient disk space
- Check Tomcat logs for errors
Database connection errors:
- Verify PostgreSQL is running
- Check credentials in
context.xml - Ensure JDBC driver is in Tomcat lib
Mesquite errors:
- Verify Apple JARs are in classpath
- Check Mesquite folder path in
context.xml - Ensure proper permissions on Mesquite directory
Memory errors:
- Increase
-Xmxvalue (current: 512m) - Monitor heap usage
- Consider
-XX:MaxPermSizefor older Java versions
This documentation focuses on the Naturalis deployment. For other environments:
- Adjust paths to match your server layout
- Use appropriate Tomcat version and directories
- Configure database credentials for your PostgreSQL instance
- Ensure Java 17 LTS is available
- Building TreeBASE - How to build the WAR files
- Technical Notes - Implementation details and troubleshooting