Installing JIRA on Jetty

PDF
PDF

These instructions will help you install JIRA on Jetty.

We wrote this document on Jetty 4.2.9, but it should work for other versions of Jetty 4. JIRA will not work on Jetty 3 as it does not have Servlet 2.3 compliance.

Please let us know if you have any problems (or it works with other versions) on the mailing list. JIRA can also be deployed on JBoss 3 with embedded Jetty - see the JBoss 3.0 guide.

1. Install Jetty

(optional - if you don't already have Jetty installed)

Download Jetty 4 from http://jetty.mortbay.org/jetty/download.html and expand the distribution to a directory.

2. Configure Jetty

Jetty does not come with a number of libraries which JIRA requires. You will need to download the dependent Jetty jars zip file and unzip into the webapp/WEB-INF/lib directory.

3. Configure JIRA

Jetty does not come with any built in support for DataSources, so we need to use Tyrex. Modify the transaction factory in the entityengine.xml file, located in the webapp/WEB-INF/classes directory.

Change the existing <transaction-factory>...</transaction-factory> tag set to:

<transaction-factory class="org.ofbiz.core.entity.transaction.TyrexFactory"/>

You also need to configure JIRA to use a JDBC driver. See the Entity Engine documentation for more details. We give examples of hsqldb and postgres below.

Here's the relevant section of the entityengine.xml file for hsqldb:

<datasource name="defaultDS"
  field-type-name="hsql"
  helper-class="org.ofbiz.core.entity.GenericHelperDAO"
  check-on-start="true" 
  use-foreign-keys="false"
  use-foreign-key-indices="false" 
  check-fks-on-start="false"
  check-fk-indices-on-start="false" 
  add-missing-on-start="true" >
  <dbcp-jdbc
	jdbc-driver="org.hsqldb.jdbcDriver"
	jdbc-uri="jdbc:hsqldb:./database/jiradb"
	jdbc-username="sa"
	jdbc-password=""/>
</datasource>

N.B. hsqldb uses dbcp-jdbc because the hsqldb driver does not implement some methods that are called by Tyrex.

Here's the relevant section of the entityengine.xml file for postgres:

<datasource name="defautDS"
  helper-class="org.ofbiz.core.entity.GenericHelperDAO"
  field-type-name="postgres" check-on-start="true"
  add-missing-on-start="true">
  <inline-jdbc
	jdbc-driver="org.postgresql.Driver"
	jdbc-uri="jdbc:postgresql://127.0.0.1/jira"
	jdbc-username="postgres"
	jdbc-password="postgres"
	isolation-level="Serializable"/>
</datasource>

4. Build JIRA

Build JIRA using 'ant war'. This will produce the web application to deploy at dist/atlassian-jira-2.0.2.war. Where 2.0.2 is the current jira version number. If you don't have ant you can download it from here

5. Deploy JIRA in Jetty

Placing the WAR in the jetty/webapps directory should cause Jetty to deploy it automatically when Jetty starts if you are using the default Jetty configuration file jetty.xml.

To run Jetty using the jetty.xml file use the following command. java -Djava.home=%JAVA_HOME% -jar start.jar etc/jetty.xml

JIRA should now be accessible at http://yourhost.com/atlassian-jira-2.0.2/