Installing JIRA on JBoss 3
| 
PDF |
These instructions will help you install JIRA on JBoss
3.x (with embedded Jetty or Tomcat). These instructions have been tested with JBoss 3.2.3.
Earlier releases are not expected to work fully (see JRA-4977, JRA-3667).
There is also separate
guide for installing JIRA on JBoss 2.4, but we recommend using JBoss 3.x rather than JBoss 2.4 if you can
(though if you have a choice, prefer Tomcat — it is significantly faster).
If you're having problems, see debugging JIRA.
1. Configure JBoss
The application server (JBoss) is responsible for establishing a database connection, and making it
available to webapps like JIRA as a "DataSource". JBoss comes with one DataSource preconfigured using a
built-in hsqldb database. You can see the configuration for this in
server/default/deploy/hsqldb-ds.xml. In the rest of this guide, we assume use of this DataSource
(called 'DefaultDS').
If you wish to use another database (MySQL, Oracle etc), create another config file in the 'deploy' directory,
eg server/default/deploy/jira-ds.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- DataSource for JIRA webapp,
called 'JiraDS' (must be same in entityengine.xml) -->
<datasources>
<local-tx-datasource>
<jndi-name>JiraDS</jndi-name>
<connection-url>jdbc:mysql://localhost/jiradb?autoReconnect=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>jira_mysql_username</user-name>
<password>jira_mysql_password</password>
</local-tx-datasource>
</datasources>
Here we have created a MySQL DataSource called 'JiraDS'. We would also have to copy the MySQL JDBC jar to
servers/default/lib/. See the database configuration page for details.
1. Configure JIRA
Open the edit-webapp/WEB-INF/classes/entityengine.xml file, and make the following changes:
1.1 Modify transaction factory attribute
Make the following changes (in bold) to the <transaction-factory> tag:
<transaction-factory
class="org.ofbiz.core.entity.transaction.JNDIFactory">
<user-transaction-jndi jndi-server-name="default"
jndi-name="UserTransaction" />
<transaction-manager-jndi jndi-server-name="default"
jndi-name="java:/TransactionManager" />
</transaction-factory>
1.2 Modify datasource attributes
Lower down in entityengine.xml, the <datasource> tag needs modifying in two
locations:
<datasource name="defaultDS"
field-type-name="hsql"
schema-name="PUBLIC"
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">
<jndi-jdbc jndi-server-name="default"
jndi-name="java:/DefaultDS"/>
</datasource>
- The field-type-name parameter needs to be set appropriately for the type of database you
use.
- The jndi-name attribute needs to point to a DataSource to use. As mentioned above, JBoss
comes preconfigured with a "DefaultDS" DataSource, which we assume use of here. If instead, you added the
MySQL DataSource above, the jndi-name value would be java:/JiraDS.
2. Build JIRA
Now build JIRA by typing build (Windows) or ./build.sh (Unix) on the command line, in
the directory where you originally extracted JIRA to. This will produce a deployable WAR file in the dist-generic directory.
3. (optional) Remove old deployments
On some versions of JBoss you may need to undeploy any old JIRA EARs/WARs and remove all deployed files before
deploying the new WAR.
4. Deploy the WAR in JBoss
Rename the WAR to jira.war, and drop it into your deployment directory (usually
jboss/server/default/deploy/). If JBoss is running, you should see messages on the JBoss console
saying that it is deploying the WAR.
Note
The version of tomcat that ships with JBoss 3.2.x ships with an earlier version of the
commons-collections.jar. JIRA requires the commons-collections-3.1.jar. You will need to replace the version
shipped with the tomcat instance in JBoss (usually found in
{JBOSS_HOME}/server/default/deploy/jbossweb-tomcat50.sar/commons-collections.jar) with the version shipped
with JIRA (usually found in {JIRA_HOME}/WEB-INF/lib/commons-collections-3.1.jar).
Start JBOSS by running bin/run.bat under the JBoss directory. Watch the startup logs for errors. Once JBoss
has started, JIRA should be accessible at http://localhost:8080/jira/ (change the host and port as
needed; the 'jira' part is whatever the WAR name is).
User-contributed notes