private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
How to use Jetty with JIRA
These instructions have been tested against:
Jetty Version |
Jira Version |
Tx Mgr & Datasource |
JVM |
Servlet & JSP |
|---|---|---|---|---|
6.0.1 |
3.6.5 |
JOTM 2.1.10 & HSQL 1.7 |
1.5 |
2.5 & 2.1 |
6.1 |
3.6.5 |
JOTM 2.1.10 & HSQL 1.7 |
1.5 |
2.5 & 2.1 |
6.1 |
3.6.5 |
Atomikos 3.1.0 & HSQL 1.7 |
1.5 |
2.5 & 2.1 |
6.1 |
3.6.5 |
Atomikos 3.1.0 & HSQL 1.7 |
1.4 |
2.5 & 2.0 |
6.1.1 |
3.8.1 |
JOTM 2.1.10 & HSQL 1.8.0.5 |
1.6 |
2.5 & 2.0 |
6.1.9 |
3.12.1 |
Atomikos 3.2.3 & HSQL 1.8.0.7 |
1.5.0_11 |
2.5 & 2.1 |
Prepare the JIRA webapp
- if you've downloaded the standalone distribution of JIRA:
- copy the commons/lib/hsqldb-*.jar into $jetty.home/lib/ext
- copy the atlassian-jira directory into your $jetty.home/webapps-plus directory (create
webapps-plusif it doesn't exist, e.g. on 6.0). - edit $jetty.home/webapps-plus/atlassian-jira/WEB-INF/classes/entityengine.xml to change from the tomcat 5-specific setup for the JNDI binding for the UserTransaction. It must be java:comp/UserTransaction and NOT java:comp/env/UserTransaction.
- if you've downloaded the webapp distribution of JIRA:
- download the hsqldb jar from the JIRA site (if you're not using the latest JIRA, go here and find the right docs version) and copy to $jetty.home/lib/ext
- without further configuring anything, build the webapp with
build.sh/build.bat, following the readme.txt instructions. - make the directory $jetty.home/webapps-plus/atlassian-jira.
- expand the atlassian-jira-3.6.5.war into it.
- edit $jetty.home/webapps-plus/atlassian-jira/WEB-INF/classes/entityengine.xml to ensure that the JNDI binding for the UserTransaction is java:comp/UserTransaction. Also check that if you are using hsqldb that the
<datasource>element at the bottom of the file has attributefield-type-name="hsql".
- regardless of which distribution you downloaded, now edit the $jetty.home/webapps-plus/atlassian-jira/WEB-INF/web.xml file:
- add a <resource-ref> for the DataSource used by JIRA:
- if you want to use a mail Session JNDI lookup, then also add a <resource-ref> for it too:

It is important that you copy the jira webapp into the directory that is setup to deploy webapps using JNDI. If you are using the default jetty setup from the distribution, then this directory will be $jetty.home/webapps-plus not $jetty.home/webapps.
- add a <resource-ref> for the DataSource used by JIRA:
Prepare Jetty
- set up the jetty installation for the transaction manager of your choice, following the instructions for JOTM here or Atomikos here (Atomikos recommended).
- copy $jetty.home/lib/jsp-2.0/jcl104-over-slf4j-1.0.1.jar and $jetty.home/lib/slf4j-simple-1.0.1.jar to $jetty.home/lib/. This configures your commons-logging implementation so that JIRA (and JOTM if you are using it) send their log messages to the same log as the jetty server, using SLF4J. Alternatively if you want to use commons-logging, you will need to copy the commons-logging jar and a commons logging impl into the $jetty.home/lib/ directory instead.
- setup the JNDI resources. To save you some time, you can use the jetty-jira-jndi.xml file attached to this page, copy it into $jetty.home/etc, and uncomment either the Atomikos or the JOTM setup as you prefer. The file also contains a mail Session JNDI binding which you can uncomment and configure if you elected to setup a <resource-ref> for it in the JIRA web.xml in previous steps.
- copy jta.properties and place it on $jetty.home/resources
There are 2 ways to deploy:
Using WebAppDeployer
- Configuration
On your jetty-plus.xml, uncomment(if its commented out) the ff: - Running:

Shortening the runline You can move all of the jetty xml configuration into a single file if you want to shorten the runline. Better yet, put it all in etc/jetty.xml and you won't even have to specify any config file on the runline, as it is the default:
Using ContextDeployer
- Configuration:
Create a "jira-context.xml" in $jetty.home/contexts and append the ff: - Running:
Addendum
For the curious, here's what the jetty-jira.xml file looks like:
At least two people have independently experienced NullPointerExceptions from XAPool with this configuration. See JRA-12653 for details. |
- If you are one of them, can you please raise a JIRA in the Jetty jira with details of the versions that you used - specifically which TM. Atomikos appears to be the better maintained TM at the moment, so it is recommended for XA.