Jetty Notes

JIRA Documentation

Index

This page has general notes on installing JIRA on Jetty. It supplements the official Jetty installation docs


A user reported:

We use a custom classloader with Jetty 5.0. Probably because
of Jetty's dependence on commons logging, Jetty was confused
over Jira's inclusion of the same jar. Also, since Jira uses
log4j to implement the logging, there was some classloading
confusion over where to find it.

To get Jira running, I removed the commons-logging jar from
Jira and placed log4j in jetty/ext/ (where commons-logging
already was). Also, I symlinked the Postgres JDBC jar into
Jira's WEB-INF/lib directory.


add your notes

Labels

 
(None)
  1. Oct 15, 2006

    Greg Wilkins says:

    JIRA works fine with Jetty and it was a simple 5 minute job to configure a JNDI ...

    JIRA works fine with Jetty and it was a simple 5 minute job to configure a JNDI data source for it.  I wish whoever wrote this page had contacted the Jetty team with their problems.

    Instructions can be seen: http://docs.codehaus.org/display/JETTY/JIRA 

    1. Oct 15, 2006

      Greg Wilkins says:

      Oops... correct link is
  2. Feb 22, 2007

    Robby Pelssers says:

    Hi all, Here is what I did for installing JIRA3.7.3 StandAlone running on Jetty6...

    Hi all,

    Here is what I did for installing JIRA3.7.3 StandAlone running on Jetty6.1 and using MySql as database.

    -Download the 3.7.3 Standard Standalone edition (atlassion-jira-standard-3.7.3-standalone.tar.gz)

    -Java1.4 or above needs to be installed

    -Create a group jira and user jira

    -Unzip jira in /usr/local and rename it to jira  (use GNU tar !!)

    $gtar -xzvf atlassion-jira-standard-3.7.3-standalone.tar.gz

    $mv  atlassion-jira-standard-3.7.3-standalone standalone

    - Change owner/group recursively to jira

    $chown -R jira jira

    $chgrp -R jira jira

    Now create following folders (for data) and change the owner/group to 'jira'  

    /usr1/jira, /usr1/attachments, /usr1/backups, /usr1/indexes 

    Changing from hsqldb to MySql:

    In mysql console:

    mysql> CREATE DATABASE jiradb CHARACTER SET 'utf8';

    mysql> GRANT ALL ON jiradb.* TO jira@'%' IDENTIFIED BY 'jira';

    mysql> GRANT ALL ON jiradb.* TO jira@localhost IDENTIFIED BY 'jira';

    Change from Tomcat (application server) to Jetty6.1: 

    (see also http://docs.codehaus.org/display/JETTY/JIRA)

    - Download JConnector version 5: mysql-connector-java-5.0.4.tar.gz from www.mysql.org 

    - Copy over the mysql-connector-java-5.0.4-bin.jar to $jetty.home/lib  

    - Copy /usr/local/jira/atlassian-jira  to /usr/local/jetty-6.1.0/webapps-plus/atlassian-jira 

    - Edit the $jetty.home/webapps-plus/atlassian-jira/WEB-INF/classes/entityengine.xml and adjust as follows:

     
    <?xml version="1.0"?>

    <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

    <!-- =============================================================== -->

    <!- Configuration file to set up the requirements of the JIRA app  ->

    <!-- =============================================================== -->

    <Configure id="Server" class="org.mortbay.jetty.Server">

      <!-- =============================================================== -->

      <!-- Configuring Transactions and XA Datasources                     -->

      <!-- Uncomment EITHER the setup for Atomikos OR for Jotm             -->

      <!-- =============================================================== -->

      <!-- START OF ATOMIKOS -->

      <Call class="java.lang.System" name="setProperty">

       <Arg>com.atomikos.icatch.file</Arg>

       <Arg>webapps-plus/test-jndi/WEB-INF/classes/jta.properties</Arg>

      </Call>

      <New id="tx" class="org.mortbay.jetty.plus.naming.Transaction">

       <Arg>

         <New class="com.atomikos.icatch.jta.UserTransactionImp"/>

       </Arg>

      </New>

       <New id="JiraDS" class="org.mortbay.jetty.plus.naming.Resource">

          <Arg>jdbc/JiraDS</Arg>

          <Arg>

           <New class="com.atomikos.jdbc.nonxa.NonXADataSourceBean">

             <Set name="Url">jdbc:mysql://localhost/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8</Set>

             <Set name="driverClassName">com.mysql.jdbc.Driver</Set>

             <Set name="user">jira</Set>

             <Set name="password">####</Set>

           </New>

          </Arg>

        </New>

      <!-- END OF ATOMIKOS -->

      <!-- =============================================================== -->

      <!-- Optional Mail Session setup                                 -->

      <!-- =============================================================== -->

     <!--

     <New id="mail" class="org.mortbay.jetty.plus.naming.Resource">

         <Arg>mail/Session</Arg>

         <Arg>

           <New class="org.mortbay.naming.factories.MailSessionReference">

             <Set name="user">CHANGEME</Set>

             <Set name="password">CHANGEME</Set>

             <Set name="properties">

               <New class="java.util.Properties">

                 <Put name="mail.smtp.host">CHANGEME</Put>

                 <Put name="mail.from">CHANGEME</Put>

                 <Put name="mail.debug">true</Put>

               </New>

              </Set>

           </New>

         </Arg>

     </New>

     -->

    </Configure>

     - Edit the $jetty.home/webapps-plus/atlassian-jira/WEB-INF/web.xml file and check if following snippet is there:

     <resource-ref>
    <description>Database for JIRA</description>
    <res-ref-name>jdbc/JiraDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

     - Copy over jcl104-over-slf4j-1.0.1.jar and slf4j-simple-1.0.1.jar from  $jetty.home/lib/jsp-2.0 to $jetty.home/lib

     - download Atomikos 3.0.1

     - Copy following jars over to the $jetty.home/lib directory

    • dist/transactions.jar
    • dist/transactions-jta.jar
    • dist/transactions-api.jar
    • dist/atomikos-util.jar
    • lib/jta.jar

    - Create a jetty-jira.xml with following content:

     
    <?xml version="1.0" encoding="UTF-8" ?>

    <!DOCTYPE entity-config PUBLIC "-//OFBiz//DTD Entity Engine Config//EN" "http://www.ofbiz.org/dtds/entity-config.dtd">

    <!--

    This file configures the OFBiz Entity Engine which JIRA uses to store persist data in a datasource.

    For detailed configuration help see:

      http://www.atlassian.com/software/jira/docs/latest/entityengine.html

    Or our server specific setup guides (these take you through the setup process for each server):

      http://www.atlassian.com/software/jira/docs/latest/servers/

    Normally, you will only need to edit the 'field-type-name' attribute of the <datasource> tag, near the bottom of this

    file.

    Less commonly, you may wish to change then JNDI lookup paths for:

     - the Transaction Manager (<transaction-factory> element)

     - Database connection (<jndi-jdbc> element).

    If you not using the 12 preconfigured DBs, you may also need to add your own field type definition

    -->

    <entity-config>

        <resource-loader name="maincp" class="org.ofbiz.core.config.ClasspathLoader"/>

        <!-- TRANSACTION FACTORY - This configures how JIRA finds the application server's transaction management.

        The default ('java:comp/UserTransaction') is fine except for Tomcat 5.5 ('java:comp/env/UserTransaction'), JBoss and

        Resin.

        - see:

           http://www.atlassian.com/software/jira/docs/latest/entityengine.html#transactionfactory

        -->

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

          <user-transaction-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>

          <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>

        </transaction-factory>

        <delegator name="default" entity-model-reader="main" entity-group-reader="main">

            <group-map group-name="default" datasource-name="defaultDS"/>

        </delegator>

        <entity-model-reader name="main">

            <resource loader="maincp" location="entitydefs/entitymodel.xml"/>

        </entity-model-reader>

        <entity-group-reader name="main" loader="maincp" location="entitydefs/entitygroup.xml"/>

        <field-type name="cloudscape" loader="maincp" location="entitydefs/fieldtype-cloudscape.xml"/>

        <field-type name="firebird" loader="maincp" location="entitydefs/fieldtype-firebird.xml"/>

        <field-type name="hsql" loader="maincp" location="entitydefs/fieldtype-hsql18.xml"/>

        <field-type name="mckoidb" loader="maincp" location="entitydefs/fieldtype-mckoidb.xml"/>

        <field-type name="mysql" loader="maincp" location="entitydefs/fieldtype-mysql.xml"/>

        <field-type name="mssql" loader="maincp" location="entitydefs/fieldtype-mssql.xml"/>

        <!--

            This field type is deprecated, and should ONLY be used with Oracle 8i.

            If you are using Oracle 9i or 10g please use Oracle 10g JDBC drivers and the 'oracle10g' field type, which is specified below

        -->

        <field-type name="oracle" loader="maincp" location="entitydefs/fieldtype-oracle.xml"/>

        <!--

            Please use this field type for Oracle 9i and 10g. Please ensure that you are using Oracle 10g JDBC drivers which are compatible with Oracle 9i.

            The 10g JDBC drivers can be downloaded from here: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

        -->

        <field-type name="oracle10g" loader="maincp" location="entitydefs/fieldtype-oracle10g.xml"/>

        <field-type name="postgres" loader="maincp" location="entitydefs/fieldtype-postgres.xml"/>

        <field-type name="postgres72" loader="maincp" location="entitydefs/fieldtype-postgres72.xml"/> <!-- use for postgres 7.2 and above -->

        <field-type name="sapdb" loader="maincp" location="entitydefs/fieldtype-sapdb.xml"/>

        <field-type name="sybase" loader="maincp" location="entitydefs/fieldtype-sybase.xml"/>

        <field-type name="db2" loader="maincp" location="entitydefs/fieldtype-db2.xml"/>

        <!--

            JRA-4202: FrontBase has 'type' and 'position' as reserved words so make the following changes the entitymodel.xml

            <field name="type" type="short-varchar"/> to <field name="type" col-name="TYPE_" type="short-varchar"/>

            <field name="type" type="long-varchar"/> to <field name="type" col-name="TYPE_" type="long-varchar"/>

            <field name="position" type="integer"/> to <field name="position" col-name="POSITION_" type="integer"/>

        -->

        <field-type name="frontbase" loader="maincp" location="entitydefs/fieldtype-frontbase.xml"/>

        <!-- DATASOURCE - You will need to update this tag for your installation.

            1. Update field-type-name attribute to match your database.

               Possible values include: cloudscape, db2, firebird, frontbase, hsql, mckoidb, mysql, mssql, oracle10g, oracle, postgres, postgres72, sapdb, sybase

            2. If using Orion, JBoss or Jetty you will need to customize the <jndi-jdbc> tag.

               See http://www.atlassian.com/software/jira/docs/latest/servers/

            3. If using Postgres 7.3+ (schema-aware), use:

                  field-type-name="postgres72"

               and:

                   schema-name="public"

               in the datasource attribute list below.

            4. If using DB2, add:

                constraint-name-clip-length="15"

               to the datasource attribute list below, and an appropriate schema-name attribute, eg:

                 schema-name="DB2INST1"

            5. If not using HSQLDB remove:

                 schema-name="PUBLIC"

            PLEASE DO NOT CHANGE the datasource name from

            defaultDS unless instructed to by Atlassian Support.

            PLEASE DO NOT set the use-foreign-key* values to "true" as JIRA does not currently support this.

         -->

        <datasource name="defaultDS" field-type-name="mysql"

         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"

         check-indices-on-start="true">

            <jndi-jdbc jndi-server-name="default" jndi-name="jdbc/JiraDS"/> 

    <!-- Orion format:

           <jndi-jdbc jndi-server-name="default" jndi-name="jdbc/JiraDS"/> -->

    <!-- JBoss format:

          <jndi-jdbc jndi-server-name="default" jndi-name="java:/DefaultDS"/> -->

    <!-- Weblogic format:

         <jndi-jdbc jndi-server-name="default" jndi-name="JiraDS"/> -->

    <!-- Jetty format

         <inline-jdbc jdbc-driver="com.mysql.jdbc.Driver" jdbc-uri="jdbc:mysql://localhost/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8" jdbc-username="jira" jdbc-password="jira" isolation-level="ReadUncommitted" />

     -->

        </datasource>

    </entity-config>

     - Copy the jetty-jira.xml over to $jetty.home/etc

    -Now you should be able to run jira in jetty with (from $jetty.home):java -jar start.jar etc/jetty.xml etc/jetty-plus.xml etc/jetty-jira.xml

     Hope this will be helpfull,

     Cheers ,

    Robby Pelssers