<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>414C485649 &#187; mysql</title>
	<atom:link href="http://alhvi.balcarcel.com/blog/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://alhvi.balcarcel.com/blog</link>
	<description>Alhvi Balcarcel&#039;s blog</description>
	<lastBuildDate>Thu, 10 Nov 2011 18:39:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Installing Jira on Glassfish.  A Step by Step Guide.</title>
		<link>http://alhvi.balcarcel.com/blog/2010/07/installing-jira-on-glassfish-a-step-by-step-guide/</link>
		<comments>http://alhvi.balcarcel.com/blog/2010/07/installing-jira-on-glassfish-a-step-by-step-guide/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 01:40:30 +0000</pubDate>
		<dc:creator>Alhvi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[jira]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://alhvi.balcarcel.com/blog/?p=73</guid>
		<description><![CDATA[For this installation we will be using: Ubuntu Server 10.04 Glassfish V3 Jira 4.1.2 MySQL 5.1 Glassfish is not officially supported as a Jira Application Server, so we need to make some changes to get it to work. This guide is a compilation of several posts and information I&#8217;ve read over the internet.  It&#8217;s the [...]]]></description>
			<content:encoded><![CDATA[<p>For this installation we will be using:</p>
<ul>
<li>Ubuntu Server 10.04</li>
<li>Glassfish V3</li>
<li>Jira 4.1.2</li>
<li>MySQL 5.1</li>
</ul>
<p>Glassfish is not officially supported as a Jira Application Server,  so we need to make some changes to get it to work. This guide is a compilation of several posts and information I&#8217;ve read over the internet.  It&#8217;s the first time I work with most of this technologies so what I did was just follow the instructions and do a little of research on my own,  but there are some things I barely understand.  So please  if you know a better way of how to do things, leave a comment,  so we all can learn and improve the guide.</p>
<p>Special thanks to:  </p>
<ul>
<li>Jason Lee for <a href="http://blogs.steeplesoft.com/2006/04/jira-and-glassfish/">this </a>tutorial</li>
<li>Michał Lipski for all the information shared <a href="http://jira.atlassian.com/browse/JRA-14604">here</a></li>
<li>Risky and Jordi for pointing out some mistakes I made</a></li>
</ul>
<p>Now, lets start with the tutorial.</p>
<p>First of all,  we need to download  the WAR/EAR version of  Jira.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.atlassian.com<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>jira<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>binary<span style="color: #000000; font-weight: bold;">/</span>atlassian-jira-enterprise-4.1.2.tar.gz</pre></div></div>

<p>Untar the document</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xjvf</span> atlassian-jira-enterprise-4.1.2.tar.gz</pre></div></div>

<p>We will identify the newly created directory:  ./atlassian-jira-enterprise-4.1.2 as $JIRA_ROOT in this tutorial.</p>
<h2>Fixing the Seraph Library</h2>
<p>We need to change some code in one of Jira&#8217;s  libraries called Seraph and create a new jar file for it.  I&#8217;ve uploaded a copy of the modified jar <a href="http://alhvi.balcarcel.com/files/blog/jira/atlassian-seraph-2.1.4.jar">here</a>,  you can use it and skip this section.  If you want to do it by yourself follow the incoming instructions.  </p>
<p>Get the Seraph code from here:</p>
<p>https://svn.atlassian.com/svn/public/atlassian/seraph/tags/atlassian-seraph-2.1.4</p>
<p>Use your favorite SVN client to get the source. The directory of the project: atlassian-seraph-2.1.4 will be called $SERAPH_ROOT from now on.</p>
<p>To compile it we need to install the <a title="Apache Maven" href="http://maven.apache.org/">maven tool</a>.  For Ubuntu type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> maven2</pre></div></div>

<p>We also need to configure Atlassian Repositories in our <a title="Maven settings" href="http://maven.apache.org/settings.html">maven settings</a>.  To do this edit the file  /etc/maven2/settings.xml and add the following lines within the profiles section <sup class='footnote'><a href='#fn-73-1' id='fnref-73-1'>1</a></sup></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AtlassianProfile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activeByDefault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activeByDefault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>atlassian-public<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>https://m2proxy.atlassian.com/repository/public<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updatePolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>daily<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updatePolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>warn<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>warn<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 	      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>atlassian-plugin-sdk<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>file://${env.ATLAS_HOME}/repository<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>warn<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pluginRepositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pluginRepository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>atlassian-public<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>https://m2proxy.atlassian.com/repository/public<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>warn<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>warn<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/checksumPolicy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pluginRepository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pluginRepositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;downloadSources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/downloadSources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;downloadJavadocs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/downloadJavadocs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/profile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now change the method init(), from the file BaseLoginFilter.java located in $SERAPH_ROOT/src/com/atlassian/seraph/filter,  to look like this:  <sup class='footnote'><a href='#fn-73-2' id='fnref-73-2'>2</a></sup></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span>FilterConfig config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//log.warn(&quot;LoginFilter.init&quot; + config.getFilterName());</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">filterConfig</span> <span style="color: #339933;">=</span> config<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> configFileLocation <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>config.<span style="color: #006633;">getInitParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;config.file&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            configFileLocation <span style="color: #339933;">=</span> config.<span style="color: #006633;">getInitParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;config.file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">//log.warn(&quot;Security config file location: &quot; + configFileLocation);</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        securityConfig <span style="color: #339933;">=</span> SecurityConfigFactory.<span style="color: #006633;">getInstance</span><span style="color: #009900;">&#40;</span>configFileLocation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        config.<span style="color: #006633;">getServletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span>SecurityConfig.<span style="color: #006633;">STORAGE_KEY</span>, securityConfig<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//log.warn(&quot;SecurityFilter.init completed successfully.&quot;);</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Change directory to $SERAPH_ROOT.  A file named pom.xml should be there.  To compile execute</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mvn package</pre></div></div>

<p>This command should build atlassian-seraph-2.1.4.jar inside the $SERAPH_ROOT/target folder.</p>
<p>Create a folder in $JIRA_ROOT/edit-webapp/WEB-INF/ called lib</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$JIRA_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>edit-webapp<span style="color: #000000; font-weight: bold;">/</span>WEB-INF<span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

<p>Copy the new seraph library to there</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$SERAPH_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>target<span style="color: #000000; font-weight: bold;">/</span>atlassian-seraph-2.1.4.jar  <span style="color: #007800;">$JIRA_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>edit-webapp<span style="color: #000000; font-weight: bold;">/</span>WEB-INF<span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

<h2>The ejb-3_0-api.jar Library</h2>
<p>I&#8217;m not sure about this step.  But in this <a href="http://jira.atlassian.com/browse/JRA-14604">bug thread </a>they said its solves a problem.</p>
<p>Download the library ejb-3_0-api.jar</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.java2s.com<span style="color: #000000; font-weight: bold;">/</span>Code<span style="color: #000000; font-weight: bold;">/</span>JarDownload<span style="color: #000000; font-weight: bold;">/</span>ejb-<span style="color: #000000;">3</span>_0-api.jar.zip</pre></div></div>

<p>Unzip and copy ejb-3_0-api.jar to $JIRA_ROOT/edit-webapp/WEB-INF/lib <sup class='footnote'><a href='#fn-73-3' id='fnref-73-3'>3</a></sup></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> ejb-<span style="color: #000000;">3</span>_0-api.jar <span style="color: #007800;">$JIRA_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>edit-webapp<span style="color: #000000; font-weight: bold;">/</span>WEB-INF<span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

<h2>The sun-web file</h2>
<p>Classloader Delegation should be switched off for Jira to run properly.  This can be configured in the sun-web.xml  flie. <sup class='footnote'><a href='#fn-73-4' id='fnref-73-4'>4</a></sup></p>
<p>Put this file in $JIRA_ROOT/edit-webapp/WEB-INF/</p>
<p>The file should contain the following text</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #00bbdd;">&lt;!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD </span>
<span style="color: #00bbdd;">  Application Server 9.0 Servlet 2.5//EN' </span>
<span style="color: #00bbdd;">  'http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd'&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sun-web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;class-loader</span> <span style="color: #000066;">delegate</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sun-web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2>The Jira user</h2>
<p>We will create a user called jira with a home directory in /usr/local/jira</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>useradd <span style="color: #660033;">--create-home</span> <span style="color: #660033;">--home-dir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>jira <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> jira</pre></div></div>

<p>Before generating the WAR file we need to tell jira where it&#8217;s home directory is located and how it will be connected to a database.</p>
<h2>Setting Jira Home</h2>
<p>Edit the file $JIRA_ROOT/edit-webapp/WEB-INF/classes/jira-application.properties.  Locate the line referring to jira home and change it</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">jira.home = /usr/local/jira</pre></div></div>

<h2>Setting up the Database Connection</h2>
<p>Edit the file $JIRA_ROOT/edit-webapp/WEB-INF/classes/entityengine.xml<br />
In the transaction-factory section change jndi-name from java:comp/env/UserTransaction to UserTransaction.  As follows.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;transaction-factory</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.ofbiz.core.entity.transaction.JNDIFactory&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;user-transaction-jndi</span> <span style="color: #000066;">jndi-server-name</span>=<span style="color: #ff0000;">&quot;default&quot;</span> <span style="color: #000066;">jndi-name</span>=<span style="color: #ff0000;">&quot;UserTransaction&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;transaction-manager-jndi</span> <span style="color: #000066;">jndi-server-name</span>=<span style="color: #ff0000;">&quot;default&quot;</span> <span style="color: #000066;">jndi-name</span>=<span style="color: #ff0000;">&quot;UserTransaction&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/transaction-factory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>In the datasource section change to the following</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;datasource</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;defaultDS&quot;</span> <span style="color: #000066;">field-type-name</span>=<span style="color: #ff0000;">&quot;mysql&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">helper-class</span>=<span style="color: #ff0000;">&quot;org.ofbiz.core.entity.GenericHelperDAO&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">check-on-start</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">use-foreign-keys</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">use-foreign-key-indices</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">check-fks-on-start</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">check-fk-indices-on-start</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">add-missing-on-start</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">check-indices-on-start</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jndi-jdbc</span> <span style="color: #000066;">jndi-server-name</span>=<span style="color: #ff0000;">&quot;default&quot;</span> <span style="color: #000066;">jndi-name</span>=<span style="color: #ff0000;">&quot;jdbc/JiraDS&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/datasource<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Notice the removal of the line</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">schema-name=&quot;PUBLIC&quot;</pre></div></div>

<p>And the jndi-name again is changed from java:comp/env/jdbc/JiraDS to only jdbc/JiraDS <sup class='footnote'><a href='#fn-73-5' id='fnref-73-5'>5</a></sup><br />
Later in this tutorial we will create the correspondent DataSource within Glassfish.</p>
<h2>Creating the DB and DBuser</h2>
<p>We need to create a jira specific database and a database user.  To do this we use MySQL console.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></div></div>

<p>Inside the console type</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">DATABASE</span> jiradb CHARACTER <span style="color: #990099; font-weight: bold;">SET</span> UTF8<span style="color: #000033;">;</span></pre></div></div>

<p>To create the user and give it the appropriate permissions execute the following</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">SELECT</span><span style="color: #000033;">,</span><span style="color: #990099; font-weight: bold;">INSERT</span><span style="color: #000033;">,</span><span style="color: #990099; font-weight: bold;">UPDATE</span><span style="color: #000033;">,</span><span style="color: #990099; font-weight: bold;">DELETE</span><span style="color: #000033;">,</span><span style="color: #990099; font-weight: bold;">CREATE</span><span style="color: #000033;">,</span><span style="color: #990099; font-weight: bold;">DROP</span><span style="color: #000033;">,</span><span style="color: #990099; font-weight: bold;">ALTER</span><span style="color: #000033;">,</span><span style="color: #990099; font-weight: bold;">INDEX</span> <span style="color: #990099; font-weight: bold;">on</span>  jiradb.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">'jirauser'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY <span style="color: #008000;">'jirauserpasswd'</span><span style="color: #000033;">;</span></pre></div></div>

<p><sup class='footnote'><a href='#fn-73-6' id='fnref-73-6'>6</a></sup></p>
<h2>Downloading MySQL Connector For Java</h2>
<p>To be able to use MySQL from Java,  as Jira does,  we need a special connector.<br />
Download it from MySQL site</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>dev.mysql.com<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>Connector-J<span style="color: #000000; font-weight: bold;">/</span>mysql-connector-java-5.1.13.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>http:<span style="color: #000000; font-weight: bold;">//</span>mirror.services.wisc.edu<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Untar the files</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> mysql-connector-java-5.1.13.tar.gz</pre></div></div>

<p>Copy the required library to your Glassfish external library directory.  My GF installation directory is: /usr/local/glassfishv3/glassfish/.   I&#8217;ll name it $GF_ROOT,  so the ext lib directory is in: $GF_ROOT/domains/domain1/lib/ext  or the one for your specific domain.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> mysql-connector-java-5.1.13<span style="color: #000000; font-weight: bold;">/</span>mysql-connector-java-5.1.13-bin.jar <span style="color: #007800;">$GF_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>domains<span style="color: #000000; font-weight: bold;">/</span>domain1<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ext</pre></div></div>

<p>Restart Glassfish<br />
Change the working directory to your Glassfish bin folder.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$GF_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>bin</pre></div></div>

<p>Stop and start again the domain</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>asadmin stop-domain domain1
.<span style="color: #000000; font-weight: bold;">/</span>asadmin start-domain domain1</pre></div></div>

<h2>Creating the Data Source on Glassfish</h2>
<p>Open your Glassfish web console.  If you left the default port set,  it should be accessible through  http://yoursite:4848,  for example</p>
<p><a href="http://localhost:4848">http://localhost:4848</a></p>
<p>Inside Glassfish Web Console Select Resources &gt; Connection Pools</p>
<p><a href="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/connection-pool.png"><img class="aligncenter size-medium wp-image-85" title="connection pool" src="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/connection-pool-207x300.png" alt="" width="207" height="300" /></a></p>
<p>Click on new and fill out the form with the following values</p>
<p><a href="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/jira-jdbc.png"><img class="aligncenter size-medium wp-image-87" title="jira jdbc" src="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/jira-jdbc-300x150.png" alt="" width="300" height="150" /></a></p>
<p>Click on next.  In the second step of the Connection Pool creation, scroll down to Additional Properties. Erase all properties loaded by default and leave only the following:</p>
<p><a href="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/additional-properties.png"><img class="aligncenter size-medium wp-image-90" title="additional properties" src="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/additional-properties-300x86.png" alt="" width="300" height="86" /></a><br />
Select the new connection pool and click ping to test it</p>
<p><a href="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/ping-connection-pool.png"><img class="aligncenter size-medium wp-image-88" title="ping connection pool" src="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/ping-connection-pool-300x197.png" alt="" width="300" height="197" /></a></p>
<p>You should see a &#8220;Ping Succeeded&#8221; message like this</p>
<p><a href="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/ping-succeeded.png"><img class="aligncenter size-medium wp-image-89" title="ping succeeded" src="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/ping-succeeded-300x110.png" alt="" width="300" height="110" /></a></p>
<p>Now, we need to create a JDBC Resource named JiraDS as we specified in the file entityengine.xml.  To do this,  click in JDBC resources.  And fill out the form with the following information,</p>
<p><a href="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/jdbc-resource-jira.png"><img class="aligncenter size-medium wp-image-91" title="jdbc resource jira" src="http://alhvi.balcarcel.com/blog/wp-content/uploads/2010/07/jdbc-resource-jira-300x204.png" alt="" width="300" height="204" /></a></p>
<h2>Constructing the WAR File and Deploying</h2>
<p>Change the current working directory to $JIRA_ROOT,  and execute</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>build.sh war</pre></div></div>

<p>The builder generates two WAR files,  one intended to be used on Tomcat,  and other dist-generic.  We will use the last one.<br />
Copy the WAR file to your Glassfish autodeploy directory.  For example,</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> .<span style="color: #000000; font-weight: bold;">/</span>dist-generic<span style="color: #000000; font-weight: bold;">/</span>atlassian-jira-4.1.2.war <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>glassfishv3<span style="color: #000000; font-weight: bold;">/</span>glassfish<span style="color: #000000; font-weight: bold;">/</span>domains<span style="color: #000000; font-weight: bold;">/</span>domain1<span style="color: #000000; font-weight: bold;">/</span>autodeploy<span style="color: #000000; font-weight: bold;">/</span>jira.war</pre></div></div>

<p>Now Jira should be accessible through   http://yourserver:yourport/jira</p>
<p><a href="http://localhost:8080/jira">http://localhost:8080/jira</a></p>
<h2>About warnings&#8230;</h2>
<p>Thanks to my new friend Benny Neugebauer I&#8217;ve know that Jira has some issues with the OpenJDK.  Here&#8217;s a post in how to uninstall it and install the Sun version.</p>
<p><a href="http://www.bennyn.de/webanwendungen/virtual-server/openjdk-deinstallieren.html">http://www.bennyn.de/webanwendungen/virtual-server/openjdk-deinstallieren.html</a></p>
<p>Also Benny wrote a post in how to properly set the mail.mime.decodeparameters  to true.  The post can be found here.</p>
<p><a href="http://www.bennyn.de/webanwendungen/virtual-server/mail-mime-decodeparameters-setzen.html">http://www.bennyn.de/webanwendungen/virtual-server/mail-mime-decodeparameters-setzen.html</a></p>
<p>Both posts are in German,  but it&#8217;s easy to understand what you have to do by reading the commands and files involved.  Thank you Benny <img src='http://alhvi.balcarcel.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<h2>Edits</h2>
<p>Edit 20100824:  Added a copy of the modified <a href="http://alhvi.balcarcel.com/files/blog/jira/atlassian-seraph-2.1.4.jar">atlassian-seraph-2.1.4.jar </a>.<br />
Edit 20100831:  Added links about how to solve Jira&#8217;s warnings.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1240px; width: 1px; height: 1px; overflow: hidden;">
<pre class="jive-pre"><code class="jive-code jive-java">&lt;profile&gt;
       &lt;id&gt;AtlassianProfile&lt;/id&gt;
       &lt;activation&gt;
         &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
       &lt;/activation&gt;

       &lt;repositories&gt;
         &lt;repository&gt;
           &lt;id&gt;atlassian-public&lt;/id&gt;
           &lt;url&gt;https:<span style="color: darkgreen;">//m2proxy.atlassian.com/repository/public&lt;/url&gt;</span>
           &lt;snapshots&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;updatePolicy&gt;daily&lt;/updatePolicy&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/snapshots&gt;
           &lt;releases&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/releases&gt;
         &lt;/repository&gt;
 	      &lt;repository&gt;
 	        &lt;id&gt;atlassian-plugin-sdk&lt;/id&gt;
           &lt;url&gt;file:<span style="color: darkgreen;">//${env.ATLAS_HOME}/repository&lt;/url&gt;</span>
           &lt;snapshots&gt;
             &lt;enabled&gt;false&lt;/enabled&gt;
           &lt;/snapshots&gt;
           &lt;releases&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/releases&gt;
         &lt;/repository&gt;
       &lt;/repositories&gt;

       &lt;pluginRepositories&gt;
         &lt;pluginRepository&gt;
           &lt;id&gt;atlassian-public&lt;/id&gt;
           &lt;url&gt;https:<span style="color: darkgreen;">//m2proxy.atlassian.com/repository/public&lt;/url&gt;</span>
           &lt;releases&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/releases&gt;
           &lt;snapshots&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/snapshots&gt;
         &lt;/pluginRepository&gt;
       &lt;/pluginRepositories&gt;
       &lt;properties&gt;
         &lt;downloadSources&gt;true&lt;/downloadSources&gt;
         &lt;downloadJavadocs&gt;true&lt;/downloadJavadocs&gt;
       &lt;/properties&gt;
    &lt;/profile&gt;
</code></pre>
</div>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-73-1'><a href="http://forums.atlassian.com/message.jspa?messageID=257336532">http://forums.atlassian.com/message.jspa?messageID=257336532</a> <span class='footnotereverse'><a href='#fnref-73-1'>&#8617;</a></span></li>
<li id='fn-73-2'><a href="http://forums.atlassian.com/message.jspa?messageID=257329197#257329197">http://forums.atlassian.com/message.jspa?messageID=257329197#257329197</a> <span class='footnotereverse'><a href='#fnref-73-2'>&#8617;</a></span></li>
<li id='fn-73-3'><a href="http://jira.atlassian.com/browse/JRA-14604">http://jira.atlassian.com/browse/JRA-14604</a> <span class='footnotereverse'><a href='#fnref-73-3'>&#8617;</a></span></li>
<li id='fn-73-4'><a href="http://jira.atlassian.com/browse/CONF-18094">http://jira.atlassian.com/browse/CONF-18094</a> <span class='footnotereverse'><a href='#fnref-73-4'>&#8617;</a></span></li>
<li id='fn-73-5'><a href="http://blogs.steeplesoft.com/2006/04/jira-and-glassfish/">http://blogs.steeplesoft.com/2006/04/jira-and-glassfish/</a> <span class='footnotereverse'><a href='#fnref-73-5'>&#8617;</a></span></li>
<li id='fn-73-6'><a href="http://confluence.atlassian.com/display/JIRA/Setting+up+JIRA+Standalone+and+MySQL+on+Linux">http://confluence.atlassian.com/display/JIRA/Setting+up+JIRA+Standalone+and+MySQL+on+Linux</a> <span class='footnotereverse'><a href='#fnref-73-6'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alhvi.balcarcel.com/blog/2010/07/installing-jira-on-glassfish-a-step-by-step-guide/feed/langswitch_lang/en/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

