Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Jetty/Howto/Deploy 3rd Party Products/JIRA"

 
(23 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
</css>
 
</css>
  
== How to Deploy JIRA ==
+
{{Jetty Howto
 +
| introduction =  
 +
[http://www.atlassian.com/software/jira/ JIRA] is a bug and issue tracker.
 +
 
 
These instructions have been tested against:
 
These instructions have been tested against:
{| class="jetty-table"
+
{{{!}} class="jetty-table"
|-
+
{{!}}-
 
! Jetty !! JIRA !! Servlet / JSP !! JVM !! Transaction Manager / DataSource
 
! Jetty !! JIRA !! Servlet / JSP !! JVM !! Transaction Manager / DataSource
|-
+
{{!}}-
| 7.0.0.RC1 || 3.13.4 || 2.5 / 2.1 || 1.5 || Atomikos 3.5.5 / HSQLDB 1.8.0.5
+
{{!}} 7.0.0.RC1 {{!}}{{!}} 3.13.4 {{!}}{{!}} 2.5 / 2.1 {{!}}{{!}} 1.5 {{!}}{{!}} Atomikos 3.5.5 / HSQLDB 1.8.0.5
|}
+
{{!}}}
  
== Steps ==
+
| steps =  
 
=== Prepare the JIRA Web Application ===
 
=== Prepare the JIRA Web Application ===
 
Start from the JIRA Standalone Distribution, and:
 
Start from the JIRA Standalone Distribution, and:
* Copy <tt>$JIRA/common/lib/hsqldb-1.8.0.5.jar</tt> to <tt>$JETTY/lib/ext/hsqldb/hsqldb-1.8.0.5.jar</tt> (create the directories as needed)
+
<ul>
* Copy <tt>$JIRA/atlassian-jira</tt> to <tt>$JETTY/contexts-available/atlassian-jira</tt>
+
<li>Copy <tt>$JIRA/common/lib/hsqldb-1.8.0.5.jar</tt> to <tt>$JETTY/lib/ext/hsqldb/hsqldb-1.8.0.5.jar</tt> (create the directories as needed).<br/>
* Modify <tt>$JETTY/contexts-available/atlassian-jira/WEB-INF/web.xml</tt>:
+
This is to install the JDBC driver. Use a different JDBC driver if you don't use HSQLDB.</li>
** add a <tt>&lt;resource-ref&gt;</tt> element for the datasource:  
+
<li>Copy <tt>$JIRA/atlassian-jira</tt> to <tt>$JETTY/contexts-available/atlassian-jira</tt></li>
**; <pre> &lt;resource-ref&gt;
+
<li>Modify <tt>$JETTY/contexts-available/atlassian-jira/WEB-INF/web.xml</tt>:</li>
**;  &lt;res-ref-name&gt;jdbc/JiraDS&lt;/res-ref-name&gt;
+
<ul>
**;  &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
+
  <li>add a <tt>&lt;resource-ref&gt;</tt> element for the datasource:
**;  &lt;res-auth&gt;SERVLET&lt;/res-auth&gt;
+
<pre><resource-ref>
**; &lt;/resource-ref&gt;</pre>
+
    <res-ref-name>jdbc/JiraDS</res-ref-name>
** if you want to use JavaMail Session, add a <tt>&lt;resource-ref&gt;</tt> for it too:
+
    <res-type>javax.sql.DataSource</res-type>
**; <pre> &lt;resource-ref&gt;
+
    <res-auth>SERVLET</res-auth>
**;  &lt;res-ref-name&gt;mail/Session&lt;/res-ref-name&gt;
+
</resource-ref></pre>
**;  &lt;res-type&gt;javax.mail.Session&lt;/res-type&gt;
+
  </li>
**;  &lt;res-auth&gt;SERVLET&lt;/res-auth&gt;
+
  <li>if you want to use email notifications, no configuration is needed apart the one available from the JIRA administration pages.</li>
**; &lt;/resource-ref&gt;</pre>
+
</ul>
* Modify <tt>$JETTY/contexts-available/atlassian-jira/WEB-INF/classes/entityengine.xml</tt>:
+
<li>Modify <tt>$JETTY/contexts-available/atlassian-jira/WEB-INF/classes/entityengine.xml</tt>:</li>
** modify the JNDI name for the user transaction from <tt>java:comp/env/UserTransaction</tt> to <tt>java:comp/UserTransaction</tt>
+
<ul>
** make sure the JNDI name for the data source is <tt>java:comp/env/jdbc/JiraDS</tt>
+
  <li>modify the JNDI name for the user transaction from <tt>java:comp/env/UserTransaction</tt> to <tt>java:comp/UserTransaction</tt></li>
 +
  <li>make sure the JNDI name for the data source is <tt>java:comp/env/jdbc/JiraDS</tt></li>
 +
  <li>If you use a different database, make sure that the attribute <tt>field-type-name</tt> of the <tt>datasource</tt> element is set to the appropriate database type (see [http://confluence.atlassian.com/display/JIRA/Installing+JIRA+on+Tomcat+5.5 here], section 2, for the possible values)</li>
 +
</ul>
 +
<li>Setup the transaction manager:</li>
 +
<ul>
 +
  <li>unzip and copy [[Media:Jta.properties.zip|jta.properties]] to <tt>$JETTY/resources</tt></li>
 +
  <li>download [http://atomikos.com Atomikos TransactionEssentials] and copy:</li>
 +
  <ul>
 +
  <li><tt>$ATOMIKOS/dist/transactions-essentials-all.jar</tt> to <tt>$JETTY/lib/ext/atomikos/transactions-essentials-all.jar</tt> (create the directories as needed)</li>
 +
  <li><tt>$ATOMIKOS/lib/jta.jar</tt> to <tt>$JETTY/lib/ext/atomikos/jta.jar</tt> (or alternatively make sure the JTA classes are available to Jetty)</li>
 +
  </ul>
 +
  <li>create the server-wide transaction manager Jetty configuration file <tt>$JETTY/etc/jetty-tm.xml</tt> with the following content:
 +
<pre><?xml version="1.0"?>
 +
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
 +
 
 +
<Configure id="Server" class="org.eclipse.jetty.server.Server">
 +
    <Call class="java.lang.System" name="setProperty">
 +
        <Arg>com.atomikos.icatch.file</Arg>
 +
        <Arg><SystemProperty name="jetty.home" default="." />/resources/jta.properties</Arg>
 +
    </Call>
 +
    <New id="user-tx" class="org.eclipse.jetty.plus.jndi.Transaction">
 +
        <Arg>
 +
            <New class="com.atomikos.icatch.jta.UserTransactionImp" />
 +
        </Arg>
 +
    </New>
 +
</Configure></pre>
 +
  </li>
 +
</ul>
 +
<li>Create the JIRA web application context configuration file <tt>$JETTY/contexts/jira.xml</tt> with the following content:
 +
<pre><?xml version="1.0"  encoding="UTF-8"?>
 +
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
 +
 +
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
 +
    <New id="jira-ds" class="org.eclipse.jetty.plus.jndi.Resource">
 +
        <Arg>jdbc/JiraDS</Arg>
 +
        <Arg>
 +
            <New class="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean">
 +
                <Set name="uniqueResourceName">jirads</Set>
 +
                <Set name="Url">jdbc:hsqldb:./database/jiradb</Set>
 +
                <Set name="driverClassName">org.hsqldb.jdbcDriver</Set>
 +
                <Set name="user">sa</Set>
 +
                <Set name="minPoolSize">1</Set>
 +
                <Set name="maxPoolSize">10</Set>
 +
            </New>
 +
        </Arg>
 +
    </New>
 +
    <Set name="contextPath">/jira</Set>
 +
    <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/contexts-available/atlassian-jira/</Set>
 +
    <Set name="configurationClasses">
 +
        <Array type="java.lang.String">
 +
            <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
 +
            <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
 +
            <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
 +
            <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
 +
            <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
 +
            <Item>org.eclipse.jetty.plus.webapp.Configuration</Item>
 +
            <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
 +
            <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
 +
        </Array>
 +
    </Set>
 +
</Configure></pre>
 +
 
 +
A note for usage with MySQL: it could be useful to add a further property to the <tt>AtomikosNonXADataSourceBean</tt> configuration that sets the <tt>testQuery</tt> that will be use to validate the connection:
 +
<pre>
 +
...
 +
<New class="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean">
 +
    ....
 +
    <Set name="testQuery">select 1</Set>
 +
</New>
 +
...
 +
</pre>
 +
See also [http://confluence.atlassian.com/display/JIRA/Surviving+Connection+Closures this page] for further details.
 +
</li>
 +
 
 +
</ul>
 +
=== Start Jetty ===
 +
Start Jetty with the following command from the $JETTY directory:
 +
<pre>
 +
java -jar start.jar OPTIONS=default,plus,jsp etc/jetty.xml etc/jetty-tm.xml
 +
</pre>
 +
}}

Latest revision as of 16:52, 28 July 2010




Introduction

JIRA is a bug and issue tracker.

These instructions have been tested against:

Jetty JIRA Servlet / JSP JVM Transaction Manager / DataSource
7.0.0.RC1 3.13.4 2.5 / 2.1 1.5 Atomikos 3.5.5 / HSQLDB 1.8.0.5


Steps

Prepare the JIRA Web Application

Start from the JIRA Standalone Distribution, and:

  • Copy $JIRA/common/lib/hsqldb-1.8.0.5.jar to $JETTY/lib/ext/hsqldb/hsqldb-1.8.0.5.jar (create the directories as needed).
    This is to install the JDBC driver. Use a different JDBC driver if you don't use HSQLDB.
  • Copy $JIRA/atlassian-jira to $JETTY/contexts-available/atlassian-jira
  • Modify $JETTY/contexts-available/atlassian-jira/WEB-INF/web.xml:
    • add a <resource-ref> element for the datasource:
      <resource-ref>
          <res-ref-name>jdbc/JiraDS</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>SERVLET</res-auth>
      </resource-ref>
    • if you want to use email notifications, no configuration is needed apart the one available from the JIRA administration pages.
  • Modify $JETTY/contexts-available/atlassian-jira/WEB-INF/classes/entityengine.xml:
    • modify the JNDI name for the user transaction from java:comp/env/UserTransaction to java:comp/UserTransaction
    • make sure the JNDI name for the data source is java:comp/env/jdbc/JiraDS
    • If you use a different database, make sure that the attribute field-type-name of the datasource element is set to the appropriate database type (see here, section 2, for the possible values)
  • Setup the transaction manager:
    • unzip and copy jta.properties to $JETTY/resources
    • download Atomikos TransactionEssentials and copy:
      • $ATOMIKOS/dist/transactions-essentials-all.jar to $JETTY/lib/ext/atomikos/transactions-essentials-all.jar (create the directories as needed)
      • $ATOMIKOS/lib/jta.jar to $JETTY/lib/ext/atomikos/jta.jar (or alternatively make sure the JTA classes are available to Jetty)
    • create the server-wide transaction manager Jetty configuration file $JETTY/etc/jetty-tm.xml with the following content:
      <?xml version="1.0"?>
      <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
      
      <Configure id="Server" class="org.eclipse.jetty.server.Server">
          <Call class="java.lang.System" name="setProperty">
              <Arg>com.atomikos.icatch.file</Arg>
              <Arg><SystemProperty name="jetty.home" default="." />/resources/jta.properties</Arg>
          </Call>
          <New id="user-tx" class="org.eclipse.jetty.plus.jndi.Transaction">
              <Arg>
                  <New class="com.atomikos.icatch.jta.UserTransactionImp" />
              </Arg>
          </New>
      </Configure>
  • Create the JIRA web application context configuration file $JETTY/contexts/jira.xml with the following content:
    <?xml version="1.0"  encoding="UTF-8"?>
    <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
     
    <Configure class="org.eclipse.jetty.webapp.WebAppContext">
        <New id="jira-ds" class="org.eclipse.jetty.plus.jndi.Resource">
            <Arg>jdbc/JiraDS</Arg>
            <Arg>
                <New class="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean">
                    <Set name="uniqueResourceName">jirads</Set>
                    <Set name="Url">jdbc:hsqldb:./database/jiradb</Set>
                    <Set name="driverClassName">org.hsqldb.jdbcDriver</Set>
                    <Set name="user">sa</Set>
                    <Set name="minPoolSize">1</Set>
                    <Set name="maxPoolSize">10</Set>
                </New>
            </Arg>
        </New>
        <Set name="contextPath">/jira</Set>
        <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/contexts-available/atlassian-jira/</Set>
        <Set name="configurationClasses">
            <Array type="java.lang.String">
                <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
                <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
                <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
                <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
                <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
                <Item>org.eclipse.jetty.plus.webapp.Configuration</Item>
                <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
                <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
            </Array>
        </Set>
    </Configure>

    A note for usage with MySQL: it could be useful to add a further property to the AtomikosNonXADataSourceBean configuration that sets the testQuery that will be use to validate the connection:

    ...
    <New class="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean">
        ....
        <Set name="testQuery">select 1</Set>
    </New>
    ...
    

    See also this page for further details.

Start Jetty

Start Jetty with the following command from the $JETTY directory:

java -jar start.jar OPTIONS=default,plus,jsp etc/jetty.xml etc/jetty-tm.xml

Back to the top