<?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/"
	>

<channel>
	<title>Web App Solution Blog &#187; tomcat</title>
	<atom:link href="http://www.webappsolution.com/wordpress/category/tomcat/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webappsolution.com/wordpress</link>
	<description>When you're in need of an appsolution</description>
	<pubDate>Thu, 05 Apr 2012 19:39:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Headless Flex Builds on EC2 Using Hudson Against Remote SVN Repo on Assembla with FlexPMD</title>
		<link>http://www.webappsolution.com/wordpress/2009/11/16/headless-builds-on-ec2-using-hudson-against-remote-svn-repo-on-assembla-with-flexpmd/</link>
		<comments>http://www.webappsolution.com/wordpress/2009/11/16/headless-builds-on-ec2-using-hudson-against-remote-svn-repo-on-assembla-with-flexpmd/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 14:37:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[assembla]]></category>

		<category><![CDATA[data visualization]]></category>

		<category><![CDATA[ec2]]></category>

		<category><![CDATA[flex]]></category>

		<category><![CDATA[flex builder]]></category>

		<category><![CDATA[flexpmd]]></category>

		<category><![CDATA[hudson]]></category>

		<category><![CDATA[svn]]></category>

		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[mxmlc]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.webappsolution.com/wordpress/?p=641</guid>
		<description><![CDATA[We&#8217;re doing a current project requiring continuous integration. We also maintain the SVN repo. There&#8217;s a lot here and you may/may not need all the pieces. We&#8217;re specifically doing headless Flex/DataViz Builds on Amazon EC2 Ubuntu with Hudson against a remote SVN repo on Assembla and have thrown in FlexPMD to see what it can [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re doing a current project requiring continuous integration. We also maintain the SVN repo. There&#8217;s a lot here and you may/may not need all the pieces. We&#8217;re specifically doing headless Flex/DataViz Builds on <a href="http://aws.amazon.com/ec2/" target="_blank">Amazon EC2</a> Ubuntu with <a href="http://hudson-ci.org/" target="_blank">Hudson</a> against a remote SVN repo on <a href="http://www.assembla.com/" target="_blank">Assembla</a> and have thrown in <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD" target="_blank">FlexPMD</a> to see what it can add to our process.</p>
<p>First, some stuff I’ll assume you already have and know how to work with:</p>
<ul>
<li> EC2 machine running in the Amazon cloud. We’re using one of the Ubuntu disty’s. I’m going to assume you have all the necessary ports open for things like email and such.</li>
<li>Hudson. We’re using version 1.326. We’ve used other CI tools but find Hudson to be very user friendly. You’ll need to have a servlet container ie Tomcat and you just pop hudson.war in and you’re ready to rock.</li>
<li>Remote SVN. You can be using a local one, but. We’re using Assembla since it’s got all the stuff we need to do business in one place and it’s simple to use. Time is money.</li>
<li>Java installed on your server. We’re using version 1.6.0_07</li>
</ul>
<p>Stuff you’ll end up downloading/installing/configuring:</p>
<ul>
<li>Flex SDK</li>
<li>Flex Dataviz components</li>
<li>SVN client</li>
<li>Ant</li>
<li>Flex Ant</li>
<li>Email</li>
</ul>
<h2><strong><span style="font-size: 10pt;">Step 1, Flex</span></strong></h2>
<p><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>192</o:Words> <o:Characters>1096</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>9</o:Lines> <o:Paragraphs>2</o:Paragraphs> <o:CharactersWithSpaces>1345</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]> <mce:style><!<br />
/* Style Definitions */<br />
table.MsoNormalTable<br />
{mso-style-name:"Table Normal";<br />
mso-tstyle-rowband-size:0;<br />
mso-tstyle-colband-size:0;<br />
mso-style-noshow:yes;<br />
mso-style-parent:"";<br />
mso-padding-alt:0in 5.4pt 0in 5.4pt;<br />
mso-para-margin-top:0in;<br />
mso-para-margin-right:0in;<br />
mso-para-margin-bottom:10.0pt;<br />
mso-para-margin-left:0in;<br />
mso-pagination:widow-orphan;<br />
font-size:12.0pt;<br />
font-family:"Times New Roman";<br />
mso-ascii-font-family:Cambria;<br />
mso-ascii-theme-font:minor-latin;<br />
mso-fareast-font-family:"Times New Roman";<br />
mso-fareast-theme-font:minor-fareast;<br />
mso-hansi-font-family:Cambria;<br />
mso-hansi-theme-font:minor-latin;}<br />
--> <!--[endif]--> <!--StartFragment--></p>
<p class="MsoNormal" style="margin-left: 0.25in;">
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">We’re currently building with the latest stable build of Flex 3.4. Get yourself all logged into your EC2 account and let’s roll. I create a flex/3.4 directory and cd to that directory and then get the latest Flex rev.<span> </span>This is the latest URL:</span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><strong><span style="font-size: 10pt;">wget <a href="http://download.macromedia.com/pub/flex/sdk/flex_sdk_3.4.zip">http://download.macromedia.com/pub/flex/sdk/flex_sdk_3.4.zip</a></span></strong></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">Let’s get the dataviz components as well since they’re a separate install</span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><strong><span style="font-size: 10pt;">wget <a href="http://download.macromedia.com/pub/flex/sdk/datavisualization_sdk_3.4.zip">http://download.macromedia.com/pub/flex/sdk/datavisualization_sdk_3.4.zip</a></span></strong></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">Oh yeah, and if you’re going to be doing unit testing, might as well get that sucker as well</span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><strong><span style="font-size: 10pt;">wget <a href="http://download.macromedia.com/pub/flex/sdk/automation_sdk_3.4.zip">http://download.macromedia.com/pub/flex/sdk/automation_sdk_3.4.zip</a></span></strong></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">Great, so we have all the pieces we need so far. You’ll want to unzip and cp these to wherever you keep your software installs on the server.<span> </span>I’m no unix guru, but, near as I could find out, the common location is /opt. </span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">So, create a /opt/flex directory and unzip the flex_sdk_3.4.zip files there. Then, copy the dataviz zip there and unzip it.</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">cp datavisualization_sdk3.4.zip /opt/flex</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">cd /opt/flex</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"> unzip datavisualization_sdk3.4.zip</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--[if gte mso 10]> <mce:style><!<br />
/* Style Definitions */<br />
table.MsoNormalTable<br />
{mso-style-name:"Table Normal";<br />
mso-tstyle-rowband-size:0;<br />
mso-tstyle-colband-size:0;<br />
mso-style-noshow:yes;<br />
mso-style-parent:"";<br />
mso-padding-alt:0in 5.4pt 0in 5.4pt;<br />
mso-para-margin-top:0in;<br />
mso-para-margin-right:0in;<br />
mso-para-margin-bottom:10.0pt;<br />
mso-para-margin-left:0in;<br />
mso-pagination:widow-orphan;<br />
font-size:12.0pt;<br />
font-family:"Times New Roman";<br />
mso-ascii-font-family:Cambria;<br />
mso-ascii-theme-font:minor-latin;<br />
mso-hansi-font-family:Cambria;<br />
mso-hansi-theme-font:minor-latin;}<br />
--> <!--[endif]--> <!--StartFragment--></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">This will extract the following into the SDK 3 installation </span></p>
<ol style="margin-top: 0in;" type="1">
<li class="MsoNormal" style="margin-top: 0.1pt; margin-bottom: 0.1pt;"><span style="font-size: 10pt; font-family: Times;">datavisualization.swc into the      frameworkslibs folder</span></li>
<li class="MsoNormal" style="margin-top: 0.1pt; margin-bottom: 0.1pt;"><span style="font-size: 10pt; font-family: Times;">datavisualization__3.0.9147.swz      and datavisualization__3.0.9147.swf into the frameworksrsls folder </span></li>
<li class="MsoNormal" style="margin-top: 0.1pt; margin-bottom: 0.1pt;"><span style="font-size: 10pt; font-family: Times;">datavisualization_rb.swc into      the appropriate frameworkslocale&lt;locale&gt; folder</span></li>
</ol>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">Let’s make sure we put the Flex compiler on the class path. On our server, the default shell is bash. You’re setup may be different, but essentially, you want to find the properties file for you shell (I’m using /root/.bashrc) and add the following line to the bottom of it:</span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><strong><span style="font-size: 10pt;">export PATH=/opt/flex/bin:$PATH</span></strong></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">Now let’s test it. You may need to log out and then back into your shell. At the command prompt, enter mxmlc and hit return. You should see something like</span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><strong><span style="font-size: 10pt;">Loading configuration file /opt/flex/frameworks/flex-config.xml</span></strong></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><strong><span style="font-size: 10pt;">Error: a target file must be specified</span></strong></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">That’s a good error. It means that the Flex compiler is now accessible on your system. If nothing comes back, you’re just at the command prompt, you may not be using the right shell properties file.</span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">In order to build projects that use the dataviz components without having the watermark on your charts and graphs, you’ll need to apply a Flex license to the installation. You do this in the flex-config.xml file located in /opt/flex/frameworks.<span> </span>Towards the bottom of the file you’ll see some commented out xml for doing so:</span></p>
<p><!--EndFragment--></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt;"><span> </span></span><span style="font-size: 8pt;">&lt;licenses&gt; <span> </span><br />
<span> </span><span> </span>&lt;license&gt;<br />
<span> </span><span> </span><span> </span>&lt;product&gt;string&lt;/product&gt;<br />
<span> </span><span> </span><span> </span><span> </span>&lt;serial-number&gt;number&lt;/serial-number&gt;<br />
<span> </span><span> </span>&lt;/license&gt;<br />
<span> </span>&lt;/licenses&gt;</span><strong></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<h2><strong><strong><span style="font-size: 10pt;">Step 2, SVN</span></strong></strong></h2>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>235</o:Words> <o:Characters>1343</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>11</o:Lines> <o:Paragraphs>2</o:Paragraphs> <o:CharactersWithSpaces>1649</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]> <mce:style><!<br />
/* Style Definitions */<br />
table.MsoNormalTable<br />
{mso-style-name:"Table Normal";<br />
mso-tstyle-rowband-size:0;<br />
mso-tstyle-colband-size:0;<br />
mso-style-noshow:yes;<br />
mso-style-parent:"";<br />
mso-padding-alt:0in 5.4pt 0in 5.4pt;<br />
mso-para-margin-top:0in;<br />
mso-para-margin-right:0in;<br />
mso-para-margin-bottom:10.0pt;<br />
mso-para-margin-left:0in;<br />
mso-pagination:widow-orphan;<br />
font-size:12.0pt;<br />
font-family:"Times New Roman";<br />
mso-ascii-font-family:Cambria;<br />
mso-ascii-theme-font:minor-latin;<br />
mso-hansi-font-family:Cambria;<br />
mso-hansi-theme-font:minor-latin;}<br />
--> <!--[endif]--> <!--StartFragment--></p>
<p class="MsoNormal" style="margin-left: 0.25in;">
<p class="MsoNormal" style="margin-left: 0.25in;">
<p class="MsoNormal" style="margin-left: 0.25in;"><span style="font-size: 10pt;">We are accessing an SVN repo on our Assembla account. The easiest way to make this happen from the EC2 is to just install SVN. So, from the command prompt:<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span></p>
<p class="MsoNormal" style="margin-left: 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">apt-get install subversion</span></strong><strong></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">If you run into any errors, I always find it helpful to refresh the list:</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">apt-get update</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"> </span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">If all went well, you should be able to log into your remote repo:</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">svn &#8211;username &lt;your_username&gt; &#8211;password &lt;your_password&gt; &#8211;no-auth-cache checkout &lt;some_project_name&gt;</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">If successful, you’re going to have a checked out version of some_project_name in your current directory.</span></p>
<h2 class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></h2>
<h2 class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></h2>
<h2><strong><strong><span style="font-size: 10pt;">Step 3, Ant<br />
</span></strong></strong></h2>
<p><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">We’re going to be using Ant as our build process. It will called via a Hudson job. Let’s get and install Ant.</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">apt-get install ant</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">Once that completes, you should be able to type ant at a command prompt. If it installed successfully, you should see something similar to (unless there happens to be a build.xml file in your current directory):</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">Buildfile: build.xml</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">BUILD FAILED</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">This is good. We now have Ant installed. The only other Ant specific thing we’ll need to do is copy the FlexTasks.jar from your Flex SDK into your new Ant install. </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">Let’s find where Ant was installed. At a command prompt:</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">which ant</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">(which will most likely return)</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">/usr/bin/ant</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><span> </span>Now, navigate to your Flex SDK Ant lib directory. The Flex SDK now contains the flexTasks.jar we need.</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">cd /opt/flex/an/lib</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">Now just copy this to the location of your Ant install’s lib directory (typical):</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">cp flexTasks.jar /usr/share/ant/lib</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"><br />
</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in;"><span style="font-size: 10pt; font-family: Times;"> </span></p>
<p style="margin: 0.1pt 0in 0.1pt 0.25in;">If you do not copy this file to the lib directory, you must specify it by using Ant&#8217;s <samp>-lib</samp></p>
<p style="margin: 0.1pt 0in 0.1pt 0.25in;">option on the command line when you make a project.</p>
<p style="margin: 0.1pt 0in 0.1pt 0.25in;">
<h2><strong><strong><span style="font-size: 10pt;">Step 4, Setup Hudson Job<br />
</span></strong></strong></h2>
<p style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p><strong><strong><strong><strong><span style="font-size: 10pt;"><br />
</span></strong></strong></strong></strong></p>
<h2 style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;"> </span></strong></p>
</h2>
<p style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong> Plugins</strong><!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */ table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:minor-latin;} --></p>
<p style="padding-left: 30px;"><!--[endif]--> <!--StartFragment--><span style="font-size: 10pt; font-family: Times;">I’m assuming you have a working familiarity with Hudson. If not, there’s a ton of info via your install directly and on the web. We have a few extra plugins installed. The Violations plugin is useful for code analysis via PMD files if you structure your ant files to use it. The Email Extension gives you a bit more flexibility than the basic email tool.</span></p>
<p><span style="font-size: 10pt; font-family: Times;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/plugins.png"><img class="aligncenter size-medium wp-image-652" title="plugins" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/plugins-300x159.png" alt="plugins" width="300" height="159" /></a></span> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>22</o:Words> <o:Characters>128</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>1</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>157</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */ table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:minor-latin;} --></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in; padding-left: 30px;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">Configuration</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">Here’s a look at few items we needed in the Hudon configuration page to get things to work smoothly</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">Specify the Ant location on your server.</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/ant.png"><img class="aligncenter size-medium wp-image-647" title="ant" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/ant-300x102.png" alt="ant" width="300" height="102" /></a><br />
</span></p>
<p style="padding-left: 30px;"><!--EndFragment--></p>
<p style="margin: 0.1pt 0in 0.1pt 0.25in; padding-left: 30px;">
<p><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>42</o:Words> <o:Characters>240</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>2</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>294</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--></p>
<p><!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */ table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:minor-latin;} --></p>
<p><!--[endif]--> <!--StartFragment--></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">For the Extended E-mail Notification plugin. We’ve defined an email account on our system called hudson. We also use gmail for our corporate email. We’re essentially relaying to gmail which requires SMTP auth and SSL (note: we haven’t entered anything in the default Hudson E-mail section):</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/email.png"><img class="aligncenter size-medium wp-image-648" title="email" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/email-300x216.png" alt="email" width="300" height="216" /></a></span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>45</o:Words> <o:Characters>258</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>2</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>316</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */ table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:minor-latin;} --></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><strong><span style="font-size: 10pt; font-family: Times;">Job Setup</span></strong></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">Go the usual steps of creating a new job. Here are the pertinent parts.</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">In Source Code Management, we’ll need to point to our remote SVN. When you click on the “?” next to the Repository URL, you will see the grey box and be able to provide login credentials to your SVN repo and test the connection:</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/svn.png"><img class="aligncenter size-medium wp-image-653" title="svn" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/svn-300x115.png" alt="svn" width="300" height="115" /></a></span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>60</o:Words> <o:Characters>347</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>2</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>426</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p><!--[endif]--> <!--StartFragment--></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">We’re not going to specify any build triggers. The reason is that Assembla gives the ability to access the post-commit hook in SVN via their “Webhook” plugin. In that tool, all we have to do is specify the Hudson job URL and with each check in of code, the project is checked out, built, and success/failure notification sent to our dev group. This is the key to the ‘continuous integration’ aspect of this whole setup.</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/webhook.png"><img class="aligncenter size-medium wp-image-654" title="webhook" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/webhook-300x207.png" alt="webhook" width="300" height="207" /></a></span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>57</o:Words> <o:Characters>326</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>2</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>400</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */ table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:minor-latin;} --></p>
<p style="padding-left: 30px;"><!--[endif]--> <!--StartFragment--><span style="font-size: 10pt; font-family: Times;">We do need to tell Hudson to use Ant to do the builds. We have a target in the build.xml file (that is in the root of our Flex project) called main.hudson. To be on the safe side, I’ve specified the full path to the build file. We specify the ant install we configured in the Hudson configuration page earlier. It would probably be helpful to give it more meaningful name like ‘ant_version_x’. </span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/jobant.png"><img class="aligncenter size-medium wp-image-650" title="jobant" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/jobant-300x132.png" alt="jobant" width="300" height="132" /></a></span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>45</o:Words> <o:Characters>259</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>2</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>318</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */ table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:minor-latin;} --></p>
<p><!--[endif]--> <!--StartFragment--></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">FlexPMD is another great tool we use that profiles your code based upon a bunch of best practices defined by the Flex group at Adobe. You can also specify your own criteria to use in the analysis. It’s worth checking out. Note the format of the XML filename pattern used. It took a while to figure that part out!</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/flexpmd.png"><img class="aligncenter size-medium wp-image-649" title="flexpmd" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/flexpmd-300x229.png" alt="flexpmd" width="300" height="229" /></a></span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Template>Normal.dotm</o:Template> <o:Revision>0</o:Revision> <o:TotalTime>0</o:TotalTime> <o:Pages>1</o:Pages> <o:Words>8</o:Words> <o:Characters>48</o:Characters> <o:Company>Web App Solution, Inc.</o:Company> <o:Lines>1</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:CharactersWithSpaces>58</o:CharactersWithSpaces> <o:Version>12.0</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting /> <w:PunctuationKerning /> <w:DrawingGridHorizontalSpacing>18 pt</w:DrawingGridHorizontalSpacing> <w:DrawingGridVerticalSpacing>18 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:DontGrowAutofit /> <w:DontAutofitConstrainedTables /> <w:DontVertAlignInTxbx /> </w:Compatibility> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="276"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */ table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:minor-latin;} --></p>
<p><!--[endif]--> <!--StartFragment--></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;">We configure the Editable Email Notification accordingly:</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><span style="font-size: 10pt; font-family: Times;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><a href="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/jobemail.png"><img class="aligncenter size-medium wp-image-651" title="jobemail" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/11/jobemail-300x79.png" alt="jobemail" width="300" height="79" /></a></p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">And that&#8217;s pretty much it. I&#8217;ll be pushing up a blog shortly that will walk through the whole ant build used for this project. It uses modules, all sorts of RSLs, FTP, and so on.</p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;">Happy Flexing.</p>
<p class="MsoNormal" style="margin: 0.1pt 0in 0.1pt 0.25in;"><!--EndFragment--></p>
<p><!--EndFragment--><!--EndFragment--></p>
<p><!--EndFragment--></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Headless+Flex+Builds+on+EC2+Using+Hudson+Against+Remote+SVN+Repo+on+Assembla+with+FlexPMD+http://pbprr.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.webappsolution.com/wordpress/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Headless+Flex+Builds+on+EC2+Using+Hudson+Against+Remote+SVN+Repo+on+Assembla+with+FlexPMD+http://pbprr.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.webappsolution.com/wordpress/2009/11/16/headless-builds-on-ec2-using-hudson-against-remote-svn-repo-on-assembla-with-flexpmd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex + Cairngorm + Spring ActionScript + Tomcat + WebORB/BlazeDS + Spring Java + Hibernate + MySQL Tutorial Part 4</title>
		<link>http://www.webappsolution.com/wordpress/2009/06/11/flex-cairngorm-spring-actionscript-tomcat-weborbblazeds-spring-java-hibernate-mysql-tutorial-part-4/</link>
		<comments>http://www.webappsolution.com/wordpress/2009/06/11/flex-cairngorm-spring-actionscript-tomcat-weborbblazeds-spring-java-hibernate-mysql-tutorial-part-4/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 14:51:25 +0000</pubDate>
		<dc:creator>brianr</dc:creator>
		
		<category><![CDATA[blazeds]]></category>

		<category><![CDATA[eclipse]]></category>

		<category><![CDATA[flex]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.webappsolution.com/wordpress/?p=289</guid>
		<description><![CDATA[Introduction
I&#8217;ve been playing around with a stack of Flex/ActionScript and Java frameworks and finally came up with one that I&#8217;m really pleased with &#8212; since I&#8217;m reusing these terms throughout the series, please review the acronyms after each, as that&#8217;s how I&#8217;ll be referring to them in the tutorial:

Flex
Cairngorm (&#8221;CG&#8221;)

Spring ActionScript (&#8221;SAS&#8221;), formerly Prana
Tomcat (&#8221;TC&#8221;)

WebORB [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>I&#8217;ve been playing around with a stack of Flex/ActionScript and Java frameworks and finally came up with one that I&#8217;m really pleased with &#8212; since I&#8217;m reusing these terms throughout the series, please review the acronyms after each, as that&#8217;s how I&#8217;ll be referring to them in the tutorial:</p>
<ul>
<li><a title="Flex" href="http://www.adobe.com/products/flex/" target="_blank">Flex</a></li>
<li><a title="Cairngorm" href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm" target="_blank">Cairngorm</a> (&#8221;CG&#8221;)<a title="Cairngorm" href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm" target="_blank"><br />
</a></li>
<li><a title="Spring ActionScript Framework" href="http://www.springsource.org/extensions/se-springactionscript-as" target="_blank">Spring ActionScript</a> (&#8221;SAS&#8221;), formerly <a title="Prana" href="http://www.pranaframework.org/" target="_blank">Prana</a></li>
<li><a title="Tomcat" href="http://tomcat.apache.org/" target="_blank">Tomcat</a> (&#8221;TC&#8221;)<a title="Tomcat" href="http://tomcat.apache.org/" target="_blank"><br />
</a></li>
<li><a title="WebORB for Java" href="http://www.themidnightcoders.com/products/weborb-for-java" target="_blank">WebORB</a> (&#8221;WORB&#8221;) /<a title="BlazeDS" href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/" target="_blank"> BlazeDS</a> (&#8221;BDS&#8221;)<a title="BlazeDS" href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/" target="_blank"><br />
</a></li>
<li><a title="Spring" href="http://www.springsource.com" target="_blank">Spring</a>, Server-side Java version</li>
<li><a title="Hibernate" href="https://www.hibernate.org/" target="_blank">Hibernate</a> (&#8221;HB&#8221;)<a title="Hibernate" href="https://www.hibernate.org/" target="_blank"><br />
</a></li>
<li><a title="MySQL" href="http://www.mysql.com/" target="_blank">MySQL</a></li>
</ul>
<p>To that, I&#8217;m planing on writing a series of tutorials where each one builds on the previous one. The final tutorial will cover: <strong>Flex + Cairngorm + Spring ActionScript + Tomcat + WebORB/BlazeDS + Spring Java + Spring Security + Hibernate + MySQL</strong></p>
<ul>
<li><a href="http://www.webappsolution.com/wordpress/2009/05/01/flex-spring-actionscript-cairngorm-tomact-blazeds-spring-hibernate-mysql-pt1/" target="_blank">Part 1: Basic Flex + CG Application</a></li>
<li><a href="http://www.webappsolution.com/wordpress/2009/05/08/flex-spring-actionscript-cairngorm-tomact-blazeds-spring-hibernate-mysql-pt2/" target="_blank">Part 2: Flex + CG + SAS</a></li>
<li><a href="http://www.webappsolution.com/wordpress/2009/05/14/flex-cairngorm-spring-actionscript-tomcat-blazeds-spring-java-hibernate-mysql-tutorial-part-3/" target="_blank">Part 3: Flex + CG + SAS + Injecting Services into Business Delegates</a></li>
<li><a href="http://www.webappsolution.com/wordpress/2009/06/11/flex-cairngorm-spring-actionscript-tomcat-weborbblazeds-spring-java-hibernate-mysql-tutorial-part-4/" target="_blank">Part 4: Integrated Flex Project + Java Project with Tomcat</a></li>
</ul>
<p>Part 4 in our series is really just a setup post that lays the groundwork for hooking in <a title="BlazeDS" href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/" target="_blank">BlazeDS</a> (&#8221;BDS&#8221;) or <a title="WebORB for Java" href="http://www.themidnightcoders.com/products/weborb-for-java" target="_blank">WebORB</a> to our existing app which we&#8217;ll do in Part 5 &#8212; I started to put Flex + Tomcat + BDS/WebORB integration all in one post, but it started getting really long &#8212; instead we&#8217;ll just focus on creating a  Java-based Dynamic Web Project with <a title="Eclipse WTP" href="http://www.eclipse.org/webtools/" target="_blank">Eclipse Web Tools Platform</a> (&#8221;WTP&#8221;) and then modifying our existing Flex project to build and deploy to our new Java project.</p>
<p><strong><span style="color: #008000;">Tutorial Goal</span></strong><strong>: Create a new Dynamic Web Project integrated with Tomcat &amp; modify our previous Flex Project to build and deploy to it.<br />
</strong></p>
<p><strong></strong></p>
<p>This is extremely basic for seasoned Java developers, but I thought it would be necessary for those that wished to learn how to integrate a Flex project with a Java project inside one Eclipse IDE.</p>
<p><strong>Assets</strong><strong></strong>:</p>
<ul>
<li><a title="Project View Source (Flex)" href="http://www.webappsolution.com/flex/blog/examples/emp-mgmt-console-4/flex/srcview/index.html" target="_blank">Project View Source (Flex)</a><a title="Project View Source" href="http://www.webappsolution.com/flex/blog/examples/emp-mgmt-console-3/srcview/index.html" target="_blank"><br />
</a></li>
<li><a title="Project Source Files (Flex)" href="http://www.webappsolution.com/flex/blog/examples/emp-mgmt-console-4/flex/srcview/EmployeeManagementConsole4.zip" target="_blank">Project Source Files (Flex)</a></li>
<li><a title="Project Source Files (Java)" href="http://www.webappsolution.com/flex/blog/examples/emp-mgmt-console-4/java/EmployeeManagementConsoleJava4.zip" target="_blank">Project Source Files (Java)</a></li>
</ul>
<p><strong>NOTE</strong>: Usually I provide a working demo, but since it&#8217;s not really any different than <a title="Part 3" href="http://www.webappsolution.com/wordpress/2009/05/14/flex-cairngorm-spring-actionscript-tomcat-blazeds-spring-java-hibernate-mysql-tutorial-part-3/" target="_blank">Part 3</a> and I didn&#8217;t have time to deploy to our <a title="Amazon EC2" href="http://aws.amazon.com/ec2/" target="_blank">Amazon EC2</a> Tomcat box, I&#8217;ll come back to it at a later date.</p>
<p><strong>Prerequisites &amp; Assumptions</strong></p>
<ul>
<li>Already have Eclipse WTP (or a similar Eclipse based Java IDE) that allows you to create Dynamic Web Projects that integrate with Tomcat.</li>
<li>Basic understanding of Java development and deployment into a web container.</li>
</ul>
<p><strong>What This Tutorial is Not</strong></p>
<p>This tutorial will not provide details on installing Eclipse WTP or other Eclipse based Java IDEs &#8212; <a title="Download WTP" href="http://download.eclipse.org/webtools/downloads/" target="_blank">go here to get a copy of WTP</a>. In addition, it will not focus on Java best-practices, but rather get the developer up to speed quickly on the integration of Flex, WTP, and Tomcat.</p>
<p><strong>NOTE</strong>: Most of the code snippets are truncated to be concise and only highlight the lines of code that truly deserve the readers attention, so it&#8217;s highly recommended that readers download the accompanying project source files in order to follow along.</p>
<p><strong>Download Tomcat Server<br />
</strong></p>
<p>To start things off we&#8217;ll simply download Tomcat so we have our application server ready to rock when we start creating our Java project. <a title="Tomcat 6.x" href="http://tomcat.apache.org/download-60.cgi" target="_blank">Go here and download the latest version of the Tomcat server as a zip</a>. At the time of writing this Tomcat 6.0.18 was the latest release.</p>
<p>As a side note, I usually stick all of my servers and app server frameworks on my local hard drive in something like this (just in case you&#8217;re trying to stay organized like me):</p>
<div class="wp-caption alignnone" style="width: 552px"><img title="Finder Tomcat Location" src="http://www.webappsolution.com/images/blog/finder-tomcat.png" alt="Location of Tomcat on Local HD" width="542" height="322" /><p class="wp-caption-text">Location of Tomcat on Local HD</p></div>
<p>Once it&#8217;s finished downloading unzip that sucker and we&#8217;ll move on to creating the Java project.</p>
<p><strong>Create a Dynamic Web Project (Java)<br />
</strong></p>
<p>Start by changing your perspective to the Java EE Development perspective and then create a new Dynamic Web Project called <strong>EmployeeManagementConsoleJava4</strong> in the same workspace as the Flex projects from the earlier tutorials (<a title="Part 1" href="http://www.webappsolution.com/wordpress/2009/05/01/flex-spring-actionscript-cairngorm-tomact-blazeds-spring-hibernate-mysql-pt1/" target="_blank">Part 1</a>, <a title="Part 2" href="http://www.webappsolution.com/wordpress/2009/05/08/flex-spring-actionscript-cairngorm-tomact-blazeds-spring-hibernate-mysql-pt2/" target="_blank">Part 2</a>, <a title="Part 3" href="http://www.webappsolution.com/wordpress/2009/05/14/flex-cairngorm-spring-actionscript-tomcat-blazeds-spring-java-hibernate-mysql-tutorial-part-3/" target="_blank">Part 3</a>)  &#8212; you can combine your Flex and Java project into one project (it&#8217;s an option when you first create your Flex project), but since we started with a plain old Flex project we&#8217;ll keep them separate for the remainder of this tutorial.</p>
<p>The <strong>Java4</strong> suffix will just help us indicate that it&#8217;s mapped to the EmployeeManagementConsole4 Flex project we&#8217;re going to create, as well as the new projects we&#8217;ll create in subsequent tutorials.</p>
<p>When you create your new Java project, you&#8217;ll be presented with the option to add a server to this project, so here we&#8217;ll select the &#8220;New&#8221; button and browse to our recently downloaded Tomcat server installation &#8212; choose Apache Tomcat v6.0 and browse to the tomcat directory we unzipped above:</p>
<div class="wp-caption alignnone" style="width: 558px"><img title="Dynamic Web Project Tomcat Setup" src="http://www.webappsolution.com/images/blog/dyn-web-proj-tomcat-setup.png" alt="Dynamic Web Project Tomcat Setup" width="548" height="605" /><p class="wp-caption-text">Dynamic Web Project Tomcat Setup</p></div>
<p>Click Finish and close out the creation of your Java project &#8212; we&#8217;ll just keep all the defaults to make things uber simple.</p>
<p><strong>Test Java Project with Tomcat Integration</strong></p>
<p>Start by creating a new index.html file in the WebContent folder in your new Project and toss in &#8220;Test&#8221; for both the title and the only node value in the &lt;body&gt; tag:</p>
<div class="wp-caption alignnone" style="width: 502px"><img title="index.html in WebContent" src="http://www.webappsolution.com/images/blog/index-html.png" alt="index.html in WebContent" width="492" height="346" /><p class="wp-caption-text">index.html in WebContent</p></div>
<p>And even though we haven&#8217;t written any Java, let&#8217;s test deploy our application to the server and start her up.</p>
<p>Down in your Server View of Eclipse (if you don&#8217;t see the server view, just goto Window -&gt; Show View -&gt; Servers), right-click on the new server we just created and and select &#8220;Add and Remove Projects&#8230;&#8221; and select your new <strong>EmployeeManagementConsoleJava4</strong> and click the Add button &#8212; you should see the project show up on the right column, indicating it&#8217;s been added to the server:</p>
<div class="wp-caption alignnone" style="width: 543px"><img title="Add Project to Tomcat" src="http://www.webappsolution.com/images/blog/tomcat-add-project.png" alt="Add Project to Tomcat" width="533" height="589" /><p class="wp-caption-text">Add Project to Tomcat</p></div>
<p>Now start your server by right-clicking on it and selecting Start &#8212; you should see the console start to fill up with logging info from the server and hopefully no errors. If you do, try going through the console&#8217;s list of errors and fixing them.</p>
<p>At this point I&#8217;ll assume you don&#8217;t have any errors and you&#8217;re ready to test your simple Java project &#8212; right-click on index.html and select Run As -&gt; Run on Server and you should see your index page open up in Eclipse&#8217;s default browser. The other option is to open up your favorite browser and entering in the following URL:</p>
<p>http://localhost:8080/EmployeeManagementConsoleJava4/index.html.</p>
<p>At this point you should see a white page with the sole word &#8220;Test&#8221; that we added to our index.html page.</p>
<p>Next we&#8217;ll move back to the Flex side and change our Flex Project&#8217;s settings to build and deploy to our new Java project.</p>
<p><strong>Create a Server-Based Flex Builder Project</strong></p>
<p>If you don&#8217;t already have the project from <a title="Part 3" href="http://www.webappsolution.com/wordpress/2009/05/14/flex-cairngorm-spring-actionscript-tomcat-blazeds-spring-java-hibernate-mysql-tutorial-part-3/" target="_blank">Part 3</a> of this series, please <a title="Download Part 3" href="http://www.webappsolution.com/flex/blog/examples/emp-mgmt-console-3/srcview/EmployeeManagementConsole3.zip" target="_blank">download it</a> and import it into Flex Builder (&#8221;FB&#8221;). Once in FB, copy and paste it into the same workspace as <strong>EmployeeManagementConsoleJava4</strong>.</p>
<p><strong>NOTE</strong>: If you don&#8217;t feel like writing all this from scratch, just download my project for Part 4 &#8212; listed above.</p>
<p><strong>Modify the Project Property Files<br />
</strong></p>
<p>Since we started our Flex project as a non-server based project, we&#8217;ll need to make some modifications to our .project, .actionScriptProperties, and .flexProperties files in order to convert the project to a server-based application. These files all exist under the root of the Flex Project&#8217;s directory &#8212; if you can&#8217;t see them, make sure you&#8217;re in either the Flex or Flex Debugging Perspective.</p>
<p>As a side note, under the covers we&#8217;re modifying the Flex Project&#8217;s Properties as if we right-clicked on the project and selected Properties.</p>
<p><strong>.actionScriptProperties</strong></p>
<p>Open up .actionScriptProperties and locate the <strong>&lt;compiler&gt;</strong> node and add or change the following attributes to look like this:</p>
<ul>
<li>outputFolderLocation=&#8221;DOCUMENTS/EmployeeManagementConsoleJava4/WebContent/flex&#8221;</li>
<li>rootURL=&#8221;http://localhost:8080/EmployeeManagementConsoleJava4/flex&#8221;</li>
</ul>
<p>Your .actionScriptProperties should look like this:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;actionScriptProperties
	mainApplicationPath="EmployeeManagementConsole4.mxml"
	version="3"&gt;

&lt;compiler
	additionalCompilerArguments="-locale en_US
	-use-network=false"
	copyDependentFiles="true"
	enableModuleDebug="true"
	generateAccessible="false"
	htmlExpressInstall="true"
	htmlGenerate="true"
	htmlHistoryManagement="true"
	htmlPlayerVersion="9.0.124"
	htmlPlayerVersionCheck="true"
	outputFolderLocation=
		"DOCUMENTS/EmployeeManagementConsoleJava4/WebContent/flex"
	outputFolderPath="bin-debug"
	rootURL="http://localhost:8080/EmployeeManagementConsoleJava4/flex"
	sourceFolderPath="src"
	strict="true"
	useApolloConfig="false"
	verifyDigests="true"
	warn="true"&gt;

&lt;compilerSourcePath/&gt;
&lt;libraryPath defaultLinkType="1"&gt;
&lt;libraryPathEntry kind="4" path=""/&gt;
&lt;libraryPathEntry kind="1" linkType="1" path="libs"/&gt;
&lt;/libraryPath&gt;
&lt;sourceAttachmentPath/&gt;
&lt;/compiler&gt;
&lt;applications&gt;
&lt;application path="EmployeeManagementConsole4.mxml"/&gt;
&lt;/applications&gt;
&lt;modules/&gt;
&lt;buildCSSFiles/&gt;
&lt;/actionScriptProperties&gt;
</code></pre>
<p><strong>.flexProperties</strong></p>
<p>Open up .flexProperties and locate the <strong>&lt;flexProperties&gt;</strong> node and add or change the following attributes to look like this:</p>
<ul>
<li>flexServerType=&#8221;2&#8243;</li>
<li>serverContextRoot=&#8221;/EmployeeManagementConsoleJava4&#8243;</li>
<li>serverRoot=&#8221;${DOCUMENTS}/EmployeeManagementConsoleJava4/WebContent&#8221;</li>
<li>serverRootURL=&#8221;http://localhost:8080/EmployeeManagementConsoleJava4/&#8221;</li>
</ul>
<p>Your .flexProperties should look like this:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;flexProperties
	flexServerType="2"
	serverContextRoot="/EmployeeManagementConsoleJava4"
	serverRoot="${DOCUMENTS}/EmployeeManagementConsoleJava4/WebContent"
	serverRootURL="http://localhost:8080/EmployeeManagementConsoleJava4/"
	toolCompile="true"
	useServerFlexSDK="false"
	version="1"/&gt;
</code></pre>
<p><strong>.project</strong></p>
<p>Open up .project and locate the <strong>&lt;projectDescription&gt;</strong> node and add the node <strong>&lt;linkedResources&gt;</strong> after the <strong>&lt;natures&gt;</strong> node inside <strong>&lt;projectDescription&gt;</strong> &#8212; simply copy and paste the &lt;linkedResources&gt; node from my code snippet below; your .project file should look like this:</p>
<p><strong>NOTE</strong>: You need to put the full, absolute path on your machine to your Java Web Project in place of the <strong>@@FULL_PATH@@</strong> key I subsituted down below for the path on my machine.</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;projectDescription&gt;
	&lt;name&gt;EmployeeManagementConsole4&lt;/name&gt;
	&lt;comment&gt;&lt;/comment&gt;
	&lt;projects&gt;
	&lt;/projects&gt;
	&lt;buildSpec&gt;
		&lt;buildCommand&gt;
			&lt;name&gt;com.adobe.flexbuilder.project.flexbuilder&lt;/name&gt;
			&lt;arguments&gt;
			&lt;/arguments&gt;
		&lt;/buildCommand&gt;
	&lt;/buildSpec&gt;
	&lt;natures&gt;
		&lt;nature&gt;com.adobe.flexbuilder.project.flexnature&lt;/nature&gt;
		&lt;nature&gt;com.adobe.flexbuilder.project.actionscriptnature&lt;/nature&gt;
	&lt;/natures&gt;
	&lt;linkedResources&gt;
		&lt;link&gt;
			&lt;name&gt;bin-debug&lt;/name&gt;
			&lt;type&gt;2&lt;/type&gt;
			&lt;location&gt;
		@@FULL_PATH@@/EmployeeManagementConsoleJava4/WebContent/flex
			&lt;/location&gt;
		&lt;/link&gt;
	&lt;/linkedResources&gt;
&lt;/projectDescription&gt;
</code></pre>
<p><strong>Check Flex Project Properties<br />
</strong></p>
<p>Just to make sure we did everything correctly, let&#8217;s check the project properties by right-click on our Flex Project and selecting Properties -&gt; Flex Build Path. It should look like this:</p>
<ul>
<li>Main source folder: src</li>
<li>Output folder: ${DOCUMENTS}/EmployeeManagementConsoleJava4/WebContent/flex</li>
<li>Output folder URL: http://localhost:8080/EmployeeManagementConsoleJava4/flex</li>
</ul>
<div class="wp-caption alignnone" style="width: 680px"><img title="Build Path Properties" src="http://www.webappsolution.com/images/blog/emp-mgmt-console-build-path-props.png" alt="Build Path Properties" width="670" height="550" /><p class="wp-caption-text">Build Path Properties</p></div>
<p>Next let&#8217;s check the Flex Server Settings: Project Properties -&gt; Flex Server:</p>
<ul>
<li>Root folder: ${DOCUMENTS}/EmployeeManagementConsoleJava4/WebContent</li>
<li>Root URL: http://localhost:8080/EmployeeManagementConsoleJava4/</li>
<li>Context root: /EmployeeManagementConsoleJava4</li>
</ul>
<div class="wp-caption alignnone" style="width: 680px"><img title="Server Properties" src="http://www.webappsolution.com/images/blog/emp-mgmt-console-server-props.png" alt="Server Properties" width="670" height="551" /><p class="wp-caption-text">Server Properties</p></div>
<p><strong>Move Assets Under Source</strong></p>
<p>Something we&#8217;re going to change here is the location of the assets directory &#8212; we&#8217;re going to move it from the root of the Flex project to the Flex src directory &#8212; this ensures that our assets are deployed with our Flex app everytime we build the application. If you run a build, you&#8217;ll now see that the assets directory is in the bin-debug directory at the same level as the actual Flex application:</p>
<div class="wp-caption alignnone" style="width: 346px"><img title="Assets Directory New Location" src="http://www.webappsolution.com/images/blog/java-proj-assets-moved.png" alt="Assets Directory New Location" width="336" height="392" /><p class="wp-caption-text">Assets Directory New Location</p></div>
<p>This also means we&#8217;ll need to make 2 quick changes in in our Flex app that point to the location of the assets directory:</p>
<p>1. Open up <strong>EmployeeManagementConsole4.mxml</strong> and locate the line where we&#8217;re loading up the Spring Application Context XML config file and modify it&#8217;s path such that it&#8217;s relative to the Flex application.</p>
<pre><code>private function loadSpringAppContext():void
{
	trace("Application loadSpringAppContext");

	var applicationContextURL:String;

	<strong>applicationContextURL = "assets/springactionscript/applicationContext.xml";</strong>

	// Initializes the <code>applicationContext</code> instance and adds listeners for the context file loading events.
	this.applicationContext = new FlexXMLApplicationContext(applicationContextURL);
	this.applicationContext.addEventListener(Event.COMPLETE, applicationContextLoadResult);
	this.applicationContext.addEventListener(IOErrorEvent.IO_ERROR, applicationContextLoadFault);
	this.applicationContext.load();
}</code></pre>
<p>2. Open up <strong>applicationContext.xml</strong> and locate the line where we set the URL to the XML data and modify it&#8217;s path such that it&#8217;s relative to the Flex application.</p>
<pre><code>&lt;property name="httpService"&gt;
	&lt;object class="mx.rpc.http.HTTPService"&gt;
		<strong>&lt;property name="url" value="assets/xml/employee_list.xml" /&gt;</strong>
		&lt;property name="resultFormat" value="e4x" /&gt;
		&lt;property name="method" value="GET" /&gt;
	&lt;/object&gt;
&lt;/property&gt;</code></pre>
<p><strong>Build and Run the Application</strong></p>
<p>Couple last things to get this thing up and running:</p>
<ol>
<li>Run a clean on the Flex project: Project -&gt; Clean</li>
<li>If you expand your Java project, you&#8217;ll see a <strong>WebContent</strong> directory and a new <strong>flex</strong> directory that was generated for us when we built our Flex project. Copy the <strong>assets</strong> directory from the root of our Flex project into WebContent</li>
<li>If your Server is already started, Stop it.</li>
<li>Right-click on the server and select Clean&#8230;</li>
<li>Restart your sever.</li>
<li>Right-click on your Flex project and select Debug As -&gt; Flex Application</li>
<li>The Flex app should show up in the browser.</li>
<li>Click the &#8220;Refresh List&#8221; bottom to make sure it still loads the list of employees.</li>
</ol>
<p>Your Flex app should show up in your browser and look just like Step 3&#8217;s finished tutorial, except that it&#8217;s running on the Tomcat application server.</p>
<div class="wp-caption alignnone" style="width: 610px"><img title="Completed Step 4 Flex App" src="http://www.webappsolution.com/images/blog/step-4-finished-app.png" alt="Completed Step 4 Flex App" width="600" height="561" /><p class="wp-caption-text">Completed Step 4 Flex App</p></div>
<p>Stay tuned for Part 5 where we integrate Flex and BlazeDS using the RemoteObject.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Flex+%2B+Cairngorm+%2B+Spring+ActionScript+%2B+Tomcat+%2B+WebORB%2FBlazeDS+%2B+Spring+Java+%2B+Hibernate+%2B+MySQL+Tutorial+Part+4+http://wwtza.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.webappsolution.com/wordpress/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Flex+%2B+Cairngorm+%2B+Spring+ActionScript+%2B+Tomcat+%2B+WebORB%2FBlazeDS+%2B+Spring+Java+%2B+Hibernate+%2B+MySQL+Tutorial+Part+4+http://wwtza.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.webappsolution.com/wordpress/2009/06/11/flex-cairngorm-spring-actionscript-tomcat-weborbblazeds-spring-java-hibernate-mysql-tutorial-part-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Tomcat in a Sensible Way in an EC2 Cloud Machine: Part 1</title>
		<link>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-1/</link>
		<comments>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-1/#comments</comments>
		<pubDate>Thu, 07 May 2009 15:17:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://www.webappsolution.com/wordpress/?p=156</guid>
		<description><![CDATA[
Part 1 2 3 4
Tomcat on EC2


A couple of us recently attended a great seminar put on by the folks at SpringSource. They discussed some great strategies for large scale deployment of TC in a sensible and extensible fashion into productions environments. The approach works as well in our dev sandboxes as it does in [...]]]></description>
			<content:encoded><![CDATA[<p><br/><br />
Part 1 <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-2/" target="_self">2</a> <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-3/" target="_self">3</a> <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-ec2-cloud-machine-part-4-final/" target="_self">4</a></p>
<h1>Tomcat on EC2</h1>
<p><br/><br />
<br/><br />
A couple of us recently attended a great seminar put on by the folks at <a href="http://www.springsource.com/" target="_blank">SpringSource</a>. They discussed some great strategies for large scale deployment of TC in a sensible and extensible fashion into productions environments. The approach works as well in our dev sandboxes as it does in production, so I&#8217;ll be following some of the best practices learned from the folks who know it best.</p>
<h4><span style="color: #000000;">What do I have and what do I need?</span></h4>
<p>Depending on the AMI you chose, Tomcat may or may not be installed. Some distributions come with TC installed already.<br />
I suggest that you don’t rely on the distribution version of TC since it may be one that has been modified by the creators of the distribution. Better to just go to the source and get the latest and greatest.</p>
<p>One great thing about using TC is that you just download the version of your choice, unzip/untar it, and you’re essentially off to the races.</p>
<h4><span style="color: #000000;">Preparation</span></h4>
<p>Similarly, many disty’s come with Java installed and they again can be specific to the disty. I always like to make sure we have the latest Sun Java installed. Feel free to use the version of your choice but your mileage may vary. I’m going to be using the Sun Java6 JDK</p>
<p style="padding-left: 30px;">Over to the terminal window and do:</p>
<p style="padding-left: 60px;">apt-get install sun-java6-jdk</p>
<p style="padding-left: 30px;">It will take a while for all this and the dependencies to all load.  When it’s complete, you can verify the install by doing:</p>
<p style="padding-left: 60px;">java –version</p>
<p style="padding-left: 60px;"><img class="alignleft size-full wp-image-160" title="javaversion1" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/05/javaversion1.png" alt="javaversion1" width="902" height="149" /></p>
<p style="padding-left: 60px;">
<p style="padding-left: 60px;">
<p style="padding-left: 60px;">
<p style="padding-left: 60px;">
<p style="padding-left: 60px;">
<h4><span style="color: #000000;">Download TC</span></h4>
<p>Let’s go to <a title="Apache Tomcat" href="http://tomcat.apache.org" target="_blank">http://tomcat.apache.org</a> There’s plenty of reading there regarding which version does what which we can leave as an exercise. Let’s grab Tomcat 6.x from the left hand side of the page under Downloads. Scroll down the next page and we have some choices:</p>
<p style="text-align: center;"><img class="size-full wp-image-161 aligncenter" title="apachetcsitelisting" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/05/apachetcsitelisting.png" alt="apachetcsitelisting" width="362" height="240" /></p>
<p>If you hover over the tar.gz link, you’ll see the path in your browser:</p>
<p style="text-align: center;"><img class="size-full wp-image-162 aligncenter" title="hoverforurl" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/05/hoverforurl.png" alt="hoverforurl" width="685" height="41" /></p>
<p>Cool. So back over to our terminal window on our EC2 machine.</p>
<p>We’ll do a wget command to get this version:</p>
<p style="padding-left: 30px;">wget http://www.devlib.org/apache/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz</p>
<p>When it’s completed:</p>
<p style="text-align: center;"><img class="size-full wp-image-164 aligncenter" title="tcdownloaded" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/05/tcdownloaded.png" alt="tcdownloaded" width="624" height="258" /></p>
<h4><span style="color: #000000;">Install TC</span></h4>
<p>Now that you’ve downloaded it, let’s move it to someplace more permanent and untar it.</p>
<p>I’m using /usr/local/tomcat but you can use the location of your choice. One of the beauties of TC is that it has no requirements regarding where you install it and almost no requirements about where you store the various folders within as we’ll learn later.</p>
<p style="padding-left: 30px;">mv apache-tomcat-6.0.14.tar.gz /usr/local/tomcat<br />
tar xvzf apache-tomcat-6.0.14.tar.gz</p>
<p>We’ve now downloaded TC and installed it to a permanent location.  Before we go any further, let’s examine what we have and what it all means.</p>
<p><span id="more-156"></span></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+an+EC2+Cloud+Machine%3A+Part+1+http://ymg29.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.webappsolution.com/wordpress/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+an+EC2+Cloud+Machine%3A+Part+1+http://ymg29.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Tomcat in a Sensible Way in an EC2 Cloud Machine: Part 2</title>
		<link>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-2/</link>
		<comments>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-2/#comments</comments>
		<pubDate>Thu, 07 May 2009 15:07:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://www.webappsolution.com/wordpress/?p=171</guid>
		<description><![CDATA[
Part 1 2 3 4
Tomcat Directories and How It Launches


Let’s pop into the tomcat directory and see what we have.
We&#8217;ll try to understand what’s in each of the directories listed
/bin
This directory is never used during runtime. It’s sole purpose is to store scripts and boostrap libs.  This directory contains the startup and stop scripts used [...]]]></description>
			<content:encoded><![CDATA[<p><br/><br />
Part <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-1/" target="_self">1</a> 2<a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-3/" target="_self"> 3</a> <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-ec2-cloud-machine-part-4-final/" target="_self">4</a></p>
<h1>Tomcat Directories and How It Launches</h1>
<p><br/><br />
<br/></p>
<h3>Let’s pop into the tomcat directory and see what we have.</h3>
<p>We&#8217;ll try to understand what’s in each of the directories listed</p>
<p style="padding-left: 30px;"><strong>/bin</strong><br />
This directory is never used during runtime. It’s sole purpose is to store scripts and boostrap libs.  This directory contains the startup and stop scripts used to launch and kill TC as well as all the scripts it they call</p>
<p style="padding-left: 30px;"><strong>/conf</strong><br />
This directory contains server level versions of the following files:</p>
<ul>
<li> context.xml
<ul>
<li>In TC, a context is an application deployed in TC</li>
</ul>
</li>
<li>tomcat-users.xml
<ul>
<li>Provides access control to applications running on the server</li>
</ul>
</li>
<li>server.xml
<ul>
<li>Provides all the connectors, ports, engines, virtual hosts configured in the server</li>
</ul>
</li>
<li>web.xml
<ul>
<li>Following the J2EE spec, this is the config file for the web applications defined at the top server level. It essentially tells the servlet engine what servlets map to which URIs, maps filters, security settings, etc.</li>
</ul>
</li>
<li>logging.properties
<ul>
<li>Allows you define the logging levels within the server although you’ll probably want to set this up on a per application basis. TC now uses the java.util.logging package for logging instead of the previous log4j as the former was found to be a source of memory leaks on hot swaps</li>
</ul>
</li>
<li>context.xml
<ul>
<li>A place to provide &lt;Context&gt; snippets. Usually, each application will contain one of these in the META-INF folder so you can control context settings at the application level</li>
</ul>
</li>
<li>catalina.policy
<ul>
<li>The JVM uses this for security decisions and only if you invoke TC with the –security option</li>
</ul>
</li>
<li>catalina.properties file
<ul>
<li>
<ul>
<li>A regular Java properties file sued to set class loader paths, security package lists, and some tunable parameters. One useful feature of it is the ability to set properties that can be referenced in other files.<br />
<strong>EG:</strong> # Some Setting<br />
some.setting=1234<br />
And in another file such as server.xml<br />
&lt;Connector port=”${some.setting}”</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>NOTE: another great feature of TC is that all of these files can exist on a per application basis as well.</p>
<p style="padding-left: 30px;"><strong> /lib</strong><br />
Contains the jars necessary to launch TC. The bootstrap process looks in CATALINA_HOME/lib directory for these jars</p>
<p style="padding-left: 30px;"><strong> /logs</strong><br />
Well, you can only imagine!</p>
<p style="padding-left: 30px;"><strong> /temp</strong><br />
This directory is used by the JVM for temporary files. (java.io.tmpdir)</p>
<p style="padding-left: 30px;"><strong> /work</strong><br />
This is a server level working directory for web applications</p>
<p style="padding-left: 30px;"><strong> /webapps</strong><br />
This is where you place your applications that run within TC.</p>
<p style="padding-left: 30px;">
<h3>Understanding the TC Launch Procedure</h3>
<p>Typical startup procedure for TC on EC2 machine goes something like this (assuming you’re using bash)</p>
<p style="padding-left: 30px;">./usr/local/tomcat/bin/startup.sh</p>
<p>By default, this should launch TC on the machine at port 8080. But before you run off and do this, let’s examine the sequence of events that take place when you run this command, the actions that are performed during this launch, and ways to simplify your life in the process.</p>
<ul>
<li> <strong>startup.sh</strong><br />
The sole purpose of this file is to locate and call catalina.sh with the start option.</li>
<li><strong>catalina.sh</strong><br />
Well, this file does quite a bit. But, the important parts are</p>
<ul>
<li>Invokes the setclasspath.sh script</li>
<li>Invokes the setenv.sh script if it exists</li>
<li>Launches the JVM (if the JVM is located)</li>
</ul>
</li>
<li><strong>setclasspath.sh</strong><br />
TC is a Java application. In order to run, it needs Java installed on the system. This script if responsible for finding the JVM and making sure it’s on the classpath to run and setting up some variables for use by the JVM. The JVM is found by examining the system classpath for the JAVA_HOME variable.  Many tutorials on this subject will tell you make sure you set the JAVA_HOME var in your ~/.bashrc file or even in the startup.sh script. Although these are acceptable, they aren’t the most extensible and flexible approach to use. Which leads us to……</li>
<li><strong>setenv.sh<br />
</strong>The catalina.sh script looks to see if there’s a setenv.sh file in CATALINA_BASE/bin. If it’s there, it’s executed prior to launching the JVM. This is the perfect place to put all of your environment settings specific to a TC instance.<br />
Further along, we’ll examine how to set up TC instances in a way that allows you to control and isolate your deployments. The setenv.sh file is a great place to store things like your JAVA_HOME variable. This allows you to switch between, let’s say, 1.5 and 1.6 and if you find there are issues in the latter, you simple switch back as needed.</p>
<p>The setenv.sh file doesn’t exist in the basic install. Simple create one and put all of your environment setting export lines in it. When it’s time to upgrade TC, simply copy it over. Quite slick!</li>
</ul>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+an+EC2+Cloud+Machine%3A+Part+2+http://zngso.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.webappsolution.com/wordpress/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+an+EC2+Cloud+Machine%3A+Part+2+http://zngso.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Tomcat in a Sensible Way in an EC2 Cloud Machine: Part 3</title>
		<link>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-3/</link>
		<comments>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-3/#comments</comments>
		<pubDate>Thu, 07 May 2009 14:55:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://www.webappsolution.com/wordpress/?p=174</guid>
		<description><![CDATA[
Part 1 2 3 4
Putting it All Together


So, based on the brilliant approach presented by Filip Hanik at SpringSource, let’s build a directory layout and a script or two that will make deployment, management, version control, and resource management intuitive.
An interesting aspect to Filip’s presentation was that he proposed having a TC instance per application. [...]]]></description>
			<content:encoded><![CDATA[<p><br/><br />
Part <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-ec2-cloud-machine-part-1/" target="_self">1</a><a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-2/" target="_self"> 2</a> 3<a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-ec2-cloud-machine-part-4-final/" target="_self"> 4</a></p>
<h1>Putting it All Together</h1>
<p><br/><br />
<br/><br />
So, based on the brilliant approach presented by <a href="http://www.springsource.com/people/fhanik" target="_blank">Filip Hanik</a> at <a href="http://www.springsource.com/" target="_blank">SpringSource</a>, let’s build a directory layout and a script or two that will make deployment, management, version control, and resource management intuitive.<br />
An interesting aspect to Filip’s presentation was that he proposed having a TC instance per application. This allows for isolation of your applications in a way that doesn’t allow performance or memory issues of one application to affect other applications. This does present more management overhead and certainly once things are clearly stable, they could be deployed in a combined environment but it was an approach I hadn’t thought of.</p>
<h3>The directory structure</h3>
<ul>
<li> <strong>/usr/local/tomcat/apache-tomcat-6.0.18/</strong><br />
This will be the basic TC install for a given version. The run script will be referencing this</li>
<li><strong>/usr/local/tomcat/run.sh<br />
</strong>The key to it all. This script will take a start|stop|run input as well as instance number(1 or 2 or etc.)</li>
<li><strong>/usr/local/tomcat/shared/<br />
</strong>This folder will contain shared instance data if you do not provide it at the instance level. So if you want to provide a specific server.xml for a given instance, place it in<br />
instance/conf/server.xml, otherwise, the one in shared/ will be used.</li>
<li>/usr/local/tomcat/instance_1/</li>
<li>/usr/local/tomcat/instance_2/<br />
…</li>
<li>/usr/local/tomcat/instance_n/<br />
These are specific TC instances.</li>
</ul>
<h3>Let’s examine some differences between instances</h3>
<p style="padding-left: 30px;">Instance_1 is running on port 8080 using jdk1.5 and has a connection timeout of 20 seconds and sets the JVM heap to 512m max and 192k per thread.</p>
<p style="padding-left: 30px;"><strong>/usr/local/tomcat/instance_1/bin/setenv.sh</strong><br />
JAVA_HOME=”/usr/local/java/jdk1.5”<br />
CATALINA_HOME=”/usr/local/apache_tomcat-6.0.18”<br />
CATALINA_BASE=”/usr/local/tomcat/instance_1”<br />
CATALINA_OPTS=”-Xmx512m –Xss192k”</p>
<p style="padding-left: 30px;"><strong>/conf/catalina.properties</strong><br />
http.port=8080</p>
<p style="padding-left: 30px;"><strong>/conf/server.xml</strong><br />
&lt;Connector port=”${http.port}”<br />
protocol=”HTTP/1.1”<br />
connectionTimeout=”20000”  /&gt;</p>
<p style="padding-left: 30px;">Instance_3 is running on port 8081 and is using jdk1.5 and has a connection timeout of 60 seconds</p>
<p style="padding-left: 30px;"><strong>/usr/local/tomcat/instance_3/bin/setenv.sh</strong><br />
JAVA_HOME=”/usr/local/java/jdk1.6”<br />
CATALINA_HOME=”/usr/local/apache_tomcat-6.0.18”<br />
CATALINA_BASE=”/usr/local/tomcat/instance_3”</p>
<p style="padding-left: 30px;"><strong>/conf/catalina.properties</strong><br />
http.port=8081</p>
<p style="padding-left: 30px;"><strong>/conf/server.xml</strong><br />
&lt;Connector port=”${http.port}”<br />
protocol=”HTTP/1.1”<br />
connectionTImeout=”60000”  /&gt;</p>
<p style="padding-left: 30px;">You can hopefully see the beauty and the benefits of an approach like this. You can isolate instances, JVMs, applications, configurations. Or, you can share various pieces and isolate others.</p>
<p style="padding-left: 30px;">If the <a href="http://www.springsource.com/events" target="_blank">Tomcat Seminar by SpringSource</a> is coming to your town, it’s a great presentation for short money.</p>
<p style="padding-left: 30px;">
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+an+EC2+Cloud+Machine%3A+Part+3+http://4hdoc.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.webappsolution.com/wordpress/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+an+EC2+Cloud+Machine%3A+Part+3+http://4hdoc.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Tomcat in a Sensible Way in EC2 Cloud Machine: Part 4 Final</title>
		<link>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-ec2-cloud-machine-part-4-final/</link>
		<comments>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-ec2-cloud-machine-part-4-final/#comments</comments>
		<pubDate>Thu, 07 May 2009 14:06:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://www.webappsolution.com/wordpress/?p=176</guid>
		<description><![CDATA[Part 1 2 3 4
Making Sure You Can Access Everything&#8230;all the time
So, we&#8217;ve come pretty far. We&#8217;ve learned what pieces were needed to install TC on our EC2 server. We&#8217;ve learned some sensible steps in configuring your deployment environment so that you can run multiple instances of TC in a sensible manner.
All we have left [...]]]></description>
			<content:encoded><![CDATA[<p>Part <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-1/" target="_self">1</a> <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-2/" target="_self">2</a> <a href="http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-an-ec2-cloud-machine-part-3/" target="_self">3</a> 4</p>
<h1>Making Sure You Can Access Everything&#8230;all the time</h1>
<p>So, we&#8217;ve come pretty far. We&#8217;ve learned what pieces were needed to install TC on our EC2 server. We&#8217;ve learned some sensible steps in configuring your deployment environment so that you can run multiple instances of TC in a sensible manner.</p>
<p>All we have left to do is make sure we can access TC via the web and ensure that the server comes back up after a re-boot (if so desired).</p>
<h3>Making TC Accessible to the Outside World</h3>
<p>Log into your EC2 management console and select the specific instance you have installed TC to. Note the Security Groups that have access to this instance. In order for the world to have access to your instance of TC, you need to enable the port you plan to run it on. In this case, we&#8217;ll enable it for the default group.</p>
<p><img class="alignleft size-full wp-image-179" title="instancegroups" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/05/instancegroups.png" alt="instancegroups" width="415" height="157" /></p>
<p>Navigate to the Security Groups in the console and select the security grouop you want to enable the port for. In this case, we&#8217;ll be enabling port 8080 for the default group.</p>
<p>In the Connection Method column, select Custom.</p>
<p>In the Protocol column, select tcp.</p>
<p>In the From Port and To Port columns, enter 8080.</p>
<p>In the Source (IP or Group) column, enter 0.0.0.0/0. This will make it available to the world.</p>
<p>Click the Save button.</p>
<p><img class="alignleft size-full wp-image-178" title="groupportaccess" src="http://www.webappsolution.com/wordpress/wp-content/uploads/2009/05/groupportaccess.png" alt="groupportaccess" width="900" height="36" /></p>
<p>Congratulations, you&#8217;re console should now be available at http://&lt;url to your instance&gt;:8080.</p>
<h3>Getting TC to Survive a Reboot</h3>
<p>Linux installs support a mechanism for restarting services via /etc/init.d. In order to create a startup script so that TC survives a reboot and comes back up, use your favorite editor and create a similar file</p>
<p>vi /etc/init.d/tomcat<br />
Paste in the following:<br />
# Tomcat auto-start<br />
#<br />
# description: Auto-starts tomcat<br />
# processname: tomcat<br />
# pidfile: /var/run/tomcat.pid<br />
case $1 in<br />
start)<br />
# uncomment and supply the correct instance for default start<br />
# we’ll only support start for this script<br />
# sh /usr/local/tomcat/run.sh start  &lt;instance number&gt;<br />
;;<br />
stop)<br />
# No need to support this since we’ll use the run.sh stop &lt;instance&gt;<br />
;;<br />
restart)<br />
# Ditto above<br />
;;<br />
esac<br />
exit 0<br />
Make sure the script is executable by:<br />
chmod 755 /etc/init.d/tomcat<br />
And finally, link the script to the startup folders with a symbolic link:<br />
ln –s /etc/init.d/tomcat /etc/rc1.d/K99tomcat<br />
ln –s /etc/init.d/tomcat /etc/rc2.d/S99tomcat</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+EC2+Cloud+Machine%3A+Part+4+Final+http://8gnso.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.webappsolution.com/wordpress/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Installing+Tomcat+in+a+Sensible+Way+in+EC2+Cloud+Machine%3A+Part+4+Final+http://8gnso.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.webappsolution.com/wordpress/2009/05/07/installing-tomcat-in-a-sensible-way-in-ec2-cloud-machine-part-4-final/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

