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

<channel>
	<title>ChangeLog - Jon Chase&#039;s blog &#187; Java &amp; Programming</title>
	<atom:link href="http://www.juliesoft.com/category/java-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.juliesoft.com</link>
	<description>solve niche problems, make users happy</description>
	<lastBuildDate>Sun, 18 Jul 2010 06:56:43 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automatic http/httpS switching with Grails</title>
		<link>http://www.juliesoft.com/2010/04/automatic-httphttps-switching-with-grails/</link>
		<comments>http://www.juliesoft.com/2010/04/automatic-httphttps-switching-with-grails/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 08:40:56 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java & Programming]]></category>
		<category><![CDATA[java groovy grails spring security http https]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/?p=336</guid>
		<description><![CDATA[
A common requirement in webapps nowadays is to switch users between a secure and insecure connection (called protocol switching).  For example, maybe your user needs to enter a password, credit card number, or some other sensitive information.  Of course, you (and the user) would like that information to be sent securely, which means [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2010%2F04%2Fautomatic-httphttps-switching-with-grails%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2010%2F04%2Fautomatic-httphttps-switching-with-grails%2F" height="61" width="51" /></a></div><p><img src="http://www.juliesoft.com/wp-content/uploads/2010/04/switch.jpg" alt="switch" title="switch" width="500" height="333" class="aligncenter size-full wp-image-356" /></p>
<p>A common requirement in webapps nowadays is to switch users between a secure and insecure connection (called <strong>protocol switching</strong>).  For example, maybe your user needs to enter a password, credit card number, or some other sensitive information.  Of course, you (and the user) would like that information to be sent securely, which means requiring http<strong>s</strong>.  Assuming you&#8217;ve already got a server set up with an SSL cert and it&#8217;s ready to serve pages over SSL, you&#8217;ll need to <strong>ensure</strong> your webapp serves all secure pages over http<strong>s</strong>.  Unfortunately, this isn&#8217;t always as easy as it seems.  But it&#8217;s not too tough either, thanks to <a href="http://grails.org">Grails</a> and <a href="http://static.springsource.org/spring-security/site/index.html">Spring Security</a>.  </p>
<p>Here are the <strong>requirements for protocol switching</strong>:</p>
<ul>
<li>Serve secure pages using http<strong>s</strong>, regardless of the link used to get to the page (i.e. http links should be redirected to http<strong>s</strong>)</li>
<li>Make protocol switching transparent to the majority of your application (i.e. links starting with <span class="mono">http://</span> will automatically get redirected to <span class="mono">http<strong>s</strong>://</span> and vice versa)</li>
<li>Easy configuration of which resources must be served as secure, insecure, or either (i.e. images, CSS, and JavaScript should be loaded using the same protocol the page uses to avoid nasty browser warnings (see below))</li>
<li>Security and protocol switching should be handled in a way such that browsers aren&#8217;t continuously popping up warning dialogs</li>
<li>Make it work in Grails</li>
</ul>
<h3>Implementation</h3>
<p>There are several ways to go about automatic protocol switching.  One of the most popular would be to use Apache and <a href="http://www.whoopis.com/howtos/apache-rewrite.html">mod_rewrite</a>.  That solution works fine, but it&#8217;s not portable between different types of servers.  </p>
<p>The solution below is pure Java, and is portable between any servlet container.  By the way, this isn&#8217;t a Grails only solution &#8211; this will work with pretty much any Java web stack &#8211; the only thing that will differ is how you wire things up.  In fact I&#8217;ve used this in a regular Spring MVC app with a regular Spring configuration&#8230;but I&#8217;m only going to show the Grails way to do it today.  </p>
<p>Here&#8217;s how to get automatic protocol switching in Grails:</p>
<ul>
<li>Add a filter definition to web.xml that intercepts all requests and handles the protocol switching and redirecting</li>
<li>Configure which URLs require which protocol</li>
<li>Test!</li>
</ul>
<h3>Adding the filter definition</h3>
<p>Spring Security has <a href="http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html#ns-requires-channel">protocol switching built in</a>, so why reinvent the wheel?  (Don&#8217;t worry, you don&#8217;t need to use any other parts of Spring Security to get protocol switching.)  Spring Security refers to protocol switching as Channel Security, but don&#8217;t worry, it&#8217;s the same thing.</p>
<p>If your Grails app isn&#8217;t already using Spring Security, add the following dependencies into grails-app/conf/BuildConfig.groovy to have Grails download the required JARs:</p>
<pre class="brush: groovy">
grails.project.dependency.resolution = {

	// ...
	// other settings...
	// ...

	dependencies {

		// ...
		// other dependencies...
		// ...

		runtime &#x27;org.springframework.security:spring-security-core:3.0.2.RELEASE&#x27; // http -&gt; https redirecting
		runtime &#x27;org.springframework.security:spring-security-web:3.0.2.RELEASE&#x27; // http -&gt; https redirecting
	}
}
</pre>
<p>You&#8217;ll need to add a Servlet Filter to web.xml now.  There are a couple of ways to do this in Grails, namely writing a plugin that can <a href="http://grails.org/doc/latest/guide/12.%20Plug-ins.html#12.7 Hooking into Runtime Configuration">modify web.xml dynamically</a>, or <a href="http://grails.org/doc/latest/ref/Command%20Line/install-templates.html">installing the Grails templates</a> into your app and manually editing web.xml.  I had planned on doing the first option (writing a plugin), but it was overkill for this, so I decided against it.  I&#8217;m glad I did.  Installing the Grails templates and modifying web.xml manually is painless.</p>
<p>Run <span class="mono">grails install-templates</span> from the root of your Grails project to install the web.xml template (along with a few others).  Next, edit <span class="mono">src/templates/war/web.xml</span> and add the filter definition and mapping in the appropriate places:</p>
<pre class="brush: xml">
&lt;!-- START: use SSL on secure pages --&gt;
&lt;filter&gt;
	&lt;filter-name&gt;channelProcessingFilter&lt;/filter-name&gt;
	&lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
&lt;/filter&gt;
&lt;!-- END: use SSL on secure pages --&gt;

&lt;!-- ... other filter definitions ... --&gt;

&lt;!-- START: use SSL on secure pages --&gt;
&lt;filter-mapping&gt;
	&lt;filter-name&gt;channelProcessingFilter&lt;/filter-name&gt;
	&lt;url-pattern&gt;/*&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;
&lt;!-- END: use SSL on secure pages --&gt;
</pre>
<p>Make sure that the filter-mapping is the first filter-mapping defined in web.xml (above <span class="mono">charEncodingFilter</span> and <span class="mono">sitemesh</span>).</p>
<p>Now to actually define the filter.  Define it as a Spring managed bean in <span class="mono">grails-app/conf/spring/resources.groovy</span>:</p>
<pre class="brush: groovy">
import org.springframework.security.web.util.AntUrlPathMatcher
import org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource
import org.springframework.security.web.access.channel.SecureChannelProcessor
import org.springframework.security.web.access.channel.InsecureChannelProcessor
import org.springframework.security.web.access.channel.ChannelProcessingFilter
import org.springframework.security.web.access.channel.ChannelDecisionManagerImpl

beans = {

	// -------------------------------------------------------------------------
	// -------------------------------------------------------------------------
	// SPRING SECURITY (CHANNEL SECURITY)
	channelDecisionManager(ChannelDecisionManagerImpl) {
		channelProcessors = [new SecureChannelProcessor(),
							new InsecureChannelProcessor()]
	}
	securityMetadataSource(DefaultFilterInvocationSecurityMetadataSource,
							new AntUrlPathMatcher(),
							ChannelConfig.getChannelConfig()) {
		stripQueryStringFromUrls = true
	}
	channelProcessingFilter(ChannelProcessingFilter) {
		channelDecisionManager = ref(&quot;channelDecisionManager&quot;)
		securityMetadataSource = ref(&quot;securityMetadataSource&quot;)
	}

}
</pre>
<p><span class="mono"><a href="http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/web/access/channel/ChannelProcessingFilter.html">channelProcessingFilter</a></span> is the filter referenced in web.xml.  It will use the <span class="mono"><a href="http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/web/access/channel/ChannelDecisionManagerImpl.html">channelDecisionManager</a></span> to decide if the current protocol (http or http<strong>s</strong>) needs to be switched to the other.  And how does <span class="mono">channelProcessingFilter</span> know which URLs require which protocol?  <span class="mono"><a href="http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/web/access/intercept/DefaultFilterInvocationSecurityMetadataSource.html">securityMetadataSource</a></span>, of course. By default, ports 80 and 8080 are considered insecure, and 443 and 8443 are considered secure.  This means that the defaults should work for both development (8080 and 8443) and production (80 and 443).  If you&#8217;re curious as to the specifics of what these beans do, check their Javadocs.  </p>
<h3>Configure which URLs require which protocol</h3>
<p>See that call above to <span class="mono">ChannelConfig.getChannelConfig()</span>?  That&#8217;s where the configuration for URLs is stored.  Create <span class="mono">grails-app/conf/ChannelConfig.groovy</span>:</p>
<pre class="brush: groovy">
import org.springframework.security.access.ConfigAttribute
import org.springframework.security.access.SecurityConfig
import org.springframework.security.web.access.intercept.RequestKey

class ChannelConfig {

	private ChannelConfig() {} // prevent instantiation

	static def getChannelConfig() {
		LinkedHashMap&lt;RequestKey,java.util.Collection&lt;ConfigAttribute&gt;&gt; requestMap = new LinkedHashMap&lt;RequestKey, Collection&lt;ConfigAttribute&gt;&gt;()

		// resources that can be served over http or https (typically whatever the containing page is served as)
		requestMap.put new RequestKey(&quot;/images/**&quot;), [new SecurityConfig(&quot;ANY_CHANNEL&quot;)]
		requestMap.put new RequestKey(&quot;/css/**&quot;), [new SecurityConfig(&quot;ANY_CHANNEL&quot;)]
		requestMap.put new RequestKey(&quot;/js/**&quot;), [new SecurityConfig(&quot;ANY_CHANNEL&quot;)]
		requestMap.put new RequestKey(&quot;/favicon.ico&quot;), [new SecurityConfig(&quot;ANY_CHANNEL&quot;)]

		// resources that must be served over https
		requestMap.put new RequestKey(&quot;/signup&quot;), [new SecurityConfig(&quot;REQUIRES_SECURE_CHANNEL&quot;)]
		requestMap.put new RequestKey(&quot;/auth/**&quot;), [new SecurityConfig(&quot;REQUIRES_SECURE_CHANNEL&quot;)]
		requestMap.put new RequestKey(&quot;/admin/**&quot;), [new SecurityConfig(&quot;REQUIRES_SECURE_CHANNEL&quot;)]
		requestMap.put new RequestKey(&quot;/app/account/edituser&quot;), [new SecurityConfig(&quot;REQUIRES_SECURE_CHANNEL&quot;)]

		// resources that must be served over http (basically everything else not already listed above)
		requestMap.put new RequestKey(&quot;/**&quot;), [new SecurityConfig(&quot;REQUIRES_INSECURE_CHANNEL&quot;)] // all other pages should be served over http

		requestMap
	}
}
</pre>
<p>What&#8217;s happening here?  First, there&#8217;s some horrible nastiness with the definition of the <span class="mono">requestMap</span> variable (gotta love generics).  This is how your configuration is stored and the format <span class="mono">securityMetadataSource</span> expects.  Each call to <span class="mono">requestMap.put()</span> specifies a URL or URL pattern (Apache Ant pattern style) and its corresponding channel security (i.e. http or http<strong>s</strong>).  </p>
<p>There are three options for channel security:</p>
<ul>
<li><span class="mono">ANY_CHANNEL</span> &#8211; Serve the resource with either http or http<strong>s</strong> &#8211; it doesn&#8217;t matter.  This is good for images, CSS, and JavaScript, which should be served using the same protocol as the containing page.</li>
<li><span class="mono">REQUIRES_SECURE_CHANNEL</span> &#8211; Serve the resource using http<strong>s</strong>.  This is what will automatically redirect the user to http<strong>s</strong> when needed.</li>
<li><span class="mono">REQUIRES_INSECURE_CHANNEL</span> &#8211; Serve the resource using http.  You don&#8217;t want to serve your entire site over http<strong>s</strong>, right?  </li>
</ul>
<p>In the configuration above, I first specified all the resources that are protocol agnostic &#8211; images, CSS, etc.  Then in the next section I specified all of the resources that must be served securely.  Finally, the <span class="mono">/**</span> specifies that anything else not already listed above will be served over plain http.</p>
<p>Note that <strong>order matters</strong> (hence the use of a LinkedHashMap that retains insertion order).  Rules should be added from most specific to least specific.  For example, if the <span class="mono">/**</span> rule was at the very top, it would match every resource request, which would be very bad.  </p>
<p>If you want to see the debug output from Spring Security as it makes its decisions about whether or not a resource is being served over the right protocol, add the following to your Log4j config in <span class="mono">grails-app/conf/Config.groovy</span>:</p>
<pre class="brush: groovy">
log4j = {

	// ...
	// ... other logging definitions
	// ...
	debug &#x27;org.springframework.security&#x27;

}
</pre>
<h3>Testing</h3>
<p>Since you&#8217;re testing your app with http<strong>s</strong>, make sure to start Grails with the <span class="mono">-http<strong>s</strong></span> option:</p>
<p><code>grails run-app -http<strong>s</strong></code></p>
<p>This will automatically set up a fake SSL certificate for your app and run http<strong>s</strong> on port 8443.  </p>
<p>You should now be able to go to <span class="mono">http://localhost:8080</span> and see that it is indeed served over http.  If you have a sign up page like configured above, navigating to <span class="mono">http://localhost:8080</span> should automatically redirect your browser to <span class="mono">http<strong>s</strong>://localhost:8443</span>.  Clicking on a link to <span class="mono">http<strong>s</strong>://localhost:8443/index</span> should then automatically take you back to <span class="mono">http://localhost:8080/index</span>.  You&#8217;ll also notice that resources like images, CSS, and JavaScript are served using whatever protocol the containing page uses.  </p>
<h3>Caveats</h3>
<p>Did you know that if an HttpSession is created over an http<strong>s</strong> connection that it won&#8217;t be available to the user when they go back to regular old http?  This means that if you have your user log in using http<strong>s</strong>, when they are redirected back to http, their session will be gone.  This won&#8217;t be a problem for you if you plan to have users always use http<strong>s</strong> once they&#8217;ve logged in.  But some sites (flickr, for example) prefer to serve most of their pages using http for performance reasons once the user has logged in securely.  There is a trick to allow http<strong>s</strong> -&gt; http session migration, but that&#8217;s a topic for a later blog post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2010/04/automatic-httphttps-switching-with-grails/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Shell scripts that talk back (and make you millions)</title>
		<link>http://www.juliesoft.com/2010/03/shell-scripts-that-talk-back-and-make-you-millions/</link>
		<comments>http://www.juliesoft.com/2010/03/shell-scripts-that-talk-back-and-make-you-millions/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 18:36:23 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java & Programming]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/?p=321</guid>
		<description><![CDATA[I&#8217;ve got a bunch of shell scripts that I use to help me with development of Every Single Shot.  Some of these scripts, like starting up a new server instance or redeploying an application, can take a while (10 to 15 minutes).  I&#8217;ll typically launch a script and then start working on something [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2010%2F03%2Fshell-scripts-that-talk-back-and-make-you-millions%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2010%2F03%2Fshell-scripts-that-talk-back-and-make-you-millions%2F" height="61" width="51" /></a></div><p>I&#8217;ve got a bunch of shell scripts that I use to help me with development of <a href="http://everysingleshot.com">Every Single Shot</a>.  Some of these scripts, like starting up a new server instance or redeploying an application, can take a while (10 to 15 minutes).  I&#8217;ll typically launch a script and then start working on something else, forgetting that the script is even running, only to come back an hour later and realize it completed 50 minutes ago.  I needed an easy way to remind myself that scripts are running, or better yet, to alert me when the scripts finish.  Specifically, I wanted something audible that would grab my attention right away, so having a shell script send an email won&#8217;t cut it in this case.  Then I realized how easy OS X makes sound playback from the terminal.</p>
<p>There are a few ways to get your shell scripts to beep or speak.  They range from utilitarian to fun, so choose wisely.  </p>
<p>Note: I&#8217;m using these on OS X &#8211; your mileage may vary on other platforms.  </p>
<h3>Terminal beep</h3>
<p>This should work even if you don&#8217;t have speakers installed on your system.  It&#8217;s pretty basic, and often times I don&#8217;t actually hear the beep, so I don&#8217;t really recommend this option.  </p>
<p>If you want your script to beep at you annoyingly, just type <code>printf &quot;\a&quot;</code> and hit enter.  You should hear a single beep (are your speakers on?).  Of course, that almost never gets my attention, so I usually wind up with something like this is my scripts: <code>printf &quot;\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a&quot;</code>  That&#8217;s a little better, but we can improve and have a little fun at the same time.</p>
<h3>Use the say command</h3>
<p>Did you know you can open a terminal on OS X, type in <code>say hello world!</code> and OS X will speak back &quot;hello world!&quot; to you?  You can&#8217;t get much simpler than that.  So instead of using the printf command above, just replace it with something like <code>say every single shot has been deployed to production</code>   </p>
<p>If you want to really impress those VCs you&#8217;re recruiting, I highly recommend the Trinoids or Zarvox voices (see all voices available in System Preferences -&gt; Speech), as they definitely lend some nerd credibility to your build process.  Those VCs will start throwing money at you (this is the part of the blog where you make millions) as they wonder in awe at how you were able to design such a complex system.  They&#8217;ll be throwing your series B funding at you just as fast as you can <code>say -v Trinoids system is running at peak efficiency</code> or <code>say -v Zarvox Skynet has become self aware.  Initiating self defense subroutine</code></p>
<p>Warning:  don&#8217;t use the Whisper voice unless you want to be freaked out, especially if you&#8217;re working late at night.</p>
<h3>Say the command yourself</h3>
<p>Or better yet, have your spouse or kid say it for you.  </p>
<p>You can use the <strong>afplay</strong> command to play MP3s or WAVs from the command line.  Just record a few messages like &quot;production instance is running&quot; using <a href="http://audacity.sourceforge.net/">Audacity</a> (free), save them as WAV or MP3 (you&#8217;ll need the <a href="http://audacity.sourceforge.net/help/faq?s=install&#038;item=lame-mp3">lame encoder</a> to save as MP3), store them in the same directory (or maybe a /sounds subdirectory) as your shell scripts with the same names as the scripts except with a .mp3 file extension, and then make the magic happen with <code>afplay redeploy_to_production.mp3</code>    </p>
<p>If you don&#8217;t want to record your voice but want something a little more personal, you can download free sound effects (I haven&#8217;t tried but I assume you can get them in MP3 or WAV format) from <a href="http://www.freesound.org/">Freesound</a>.</p>
<p>If you have ideas on how to accomplish some of the above on Windows, Unix/Linux, or another platform, please leave a comment below!</p>
<p>I gotta run&#8230;it sounds like my build just finished!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2010/03/shell-scripts-that-talk-back-and-make-you-millions/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ChangeLog #2: Storing photos and little else</title>
		<link>http://www.juliesoft.com/2010/02/changelog-2-storing-photos-and-little-else/</link>
		<comments>http://www.juliesoft.com/2010/02/changelog-2-storing-photos-and-little-else/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 13:09:49 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[ChangeLog]]></category>
		<category><![CDATA[Every Single Shot]]></category>
		<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/?p=296</guid>
		<description><![CDATA[Total earnings as of February 11th, 2010: $0
This week was a lot slower than I had hoped it would be.  I don&#8217;t think I made enough progress to be able to launch a beta (remember to sign up) on February 15th (4 days from now!) &#8211; but I&#8217;m still shooting for it.
Safe, secure photo [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2010%2F02%2Fchangelog-2-storing-photos-and-little-else%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2010%2F02%2Fchangelog-2-storing-photos-and-little-else%2F" height="61" width="51" /></a></div><h3><strong>Total earnings as of February 11th, 2010: $0</strong></h3>
<p>This week was a lot slower than I had hoped it would be.  I don&#8217;t think I made enough progress to be able to launch a beta (<a href="http://www.everysingleshot.com">remember to sign up</a>) on February 15th (4 days from now!) &#8211; but I&#8217;m still shooting for it.</p>
<h3>Safe, secure photo storage</h3>
<p>I&#8217;ve been working on hooking up <a href="http://www.everysingleshot.com">Every Single Shot</a> to <a href="http://aws.amazon.com/s3/">Amazon&#8217;s S3</a> (Simple Storage Service).  This is where all of the photos for Every Single Shot will be stored.  According to Amazon, I&#8217;m using S3 because it&#8217;s secure, reliable, fault tolerant, flexible, competitively priced, and most importantly has something to do with &quot;cloud&quot;.  I use it because it&#8217;s easy to work with, stores data redundantly, cheap, and easy to get started with.  </p>
<p>I&#8217;m using <a href="http://jets3t.s3.amazonaws.com/index.html">JetS3t</a> (of course the <a href="http://jets3t.s3.amazonaws.com/index.html">JetS3t site</a> is completely hosted in S3) to work with S3 from Grails.  I love it and highly recommend it.  That&#8217;s all I have to say about that.  </p>
<p>I&#8217;ve been able to reuse a lot of code that I developed for <a href="http://www.sendalong.com">SendAlong</a>, which was a huge blessing and time saver (let alone a validation (at least in my mind) that I can write some reusable code &#8211; there&#8217;s a first time for everything).  </p>
<h3>If you build it&#8230;the build will fail</h3>
<p><a href="http://www.jetbrains.com/teamcity/">My continuous integration server</a> is great, but it can be a time suck sometimes (when it rains, it pours).  I&#8217;d much rather be working on features for Every Single Shot than futzing around with trying to fix an ArrayIndexOutOfBoundsException, but hey, you gotta keep the builds happy.  </p>
<p>Once I release ESS and get it somewhat stable I&#8217;d love to build in some kind of <a href="http://www.infoq.com/news/2010/01/continuous-deployment-trenches">continuous deployment</a> to my development/release process.  Having a build server is the first step towards that, I guess.</p>
<h3>Next week&#8217;s goals</h3>
<p>There&#8217;s only one goal I&#8217;m focusing on now:</p>
<ul>
<li>Release the Every Single Shot beta on February 15th (stretch)</li>
</ul>
<p>Wish me luck.  See you next week!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2010/02/changelog-2-storing-photos-and-little-else/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REVISITED: What is Right with Grails and Wrong with Maven</title>
		<link>http://www.juliesoft.com/2009/10/revisited-what-is-right-with-grails-and-wrong-with-maven/</link>
		<comments>http://www.juliesoft.com/2009/10/revisited-what-is-right-with-grails-and-wrong-with-maven/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 06:43:48 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/2009/10/20/revisited-what-is-right-with-grails-and-wrong-with-maven/</guid>
		<description><![CDATA[With regard to my previous post, it looks like I pulled the Maven command from an old set of documentation.  I believe the preferred way to create a new Grails app with Maven is a command like the following:
mvn grails:create-app appName
I can&#8217;t say I don&#8217;t have anything against Maven, because I don&#8217;t like it. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2009%2F10%2Frevisited-what-is-right-with-grails-and-wrong-with-maven%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2009%2F10%2Frevisited-what-is-right-with-grails-and-wrong-with-maven%2F" height="61" width="51" /></a></div><p>With regard to <a href="http://www.juliesoft.com/2009/10/15/what-is-right-with-grails-and-wrong-with-maven/">my previous post</a>, it looks like I pulled the Maven command from an <a href="http://grails.org/Maven+Integration">old set of documentation</a>.  I believe <a href="http://forge.octo.com/maven/sites/mtg/grails-maven-plugin/create-app-mojo.html">the preferred way</a> to create a new Grails app with Maven is a command like the following:</p>
<p><code>mvn grails:create-app appName</code></p>
<p>I can&#8217;t say I don&#8217;t have anything against Maven, because I don&#8217;t like it. <img src='http://www.juliesoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Personally I&#8217;ve had much better luck with Ant, but then I&#8217;ve never worked in a highly distributed team environment with lots of dependencies and builds that couldn&#8217;t be managed with a simple Ant script.</p>
<p>Let the holy wars continue&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2009/10/revisited-what-is-right-with-grails-and-wrong-with-maven/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What is Right with Grails and Wrong with Maven</title>
		<link>http://www.juliesoft.com/2009/10/what-is-right-with-grails-and-wrong-with-maven/</link>
		<comments>http://www.juliesoft.com/2009/10/what-is-right-with-grails-and-wrong-with-maven/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 03:50:08 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/2009/10/15/what-is-right-with-grails-and-wrong-with-maven/</guid>
		<description><![CDATA[This just cracks me up.Here&#8217;s how to create a Grails app using the Grails command line:grails create-app demoAnd here&#8217;s how to create the app using the Maven command line:mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.1 -DgroupId=example -DartifactId=demo
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2009%2F10%2Fwhat-is-right-with-grails-and-wrong-with-maven%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2009%2F10%2Fwhat-is-right-with-grails-and-wrong-with-maven%2F" height="61" width="51" /></a></div><p>This just cracks me up.Here&#8217;s how to create a Grails app using the Grails command line:<code>grails create-app demo</code>And here&#8217;s how to create the app using the Maven command line:<code>mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.1 -DgroupId=example -DartifactId=demo</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2009/10/what-is-right-with-grails-and-wrong-with-maven/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Amazon EC2 now offers STATIC IPs</title>
		<link>http://www.juliesoft.com/2008/03/amazon-ec2-now-offers-static-ips/</link>
		<comments>http://www.juliesoft.com/2008/03/amazon-ec2-now-offers-static-ips/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 13:30:45 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/2008/03/27/amazon-ec2-now-offers-static-ips/</guid>
		<description><![CDATA[This is great news for any Amazon EC2 (Elastic Compute Cloud) developer &#8211; up until this point, hosting web sites on EC2 has been a little tricky due to the fact that EC2 instances used dynamic IPs &#8211; making it tough to set up reliable load balancing and failover in the face of ever-changing IP [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Famazon-ec2-now-offers-static-ips%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Famazon-ec2-now-offers-static-ips%2F" height="61" width="51" /></a></div><p><img src="http://www.juliesoft.com/wp-content/uploads/2008/03/aws1.gif" class="float-left" alt="Amazon EC2 now offers STATIC IPs" />This is great news for any <a href="http://www.amazon.com/gp/browse.html?node=201590011">Amazon EC2</a> (Elastic Compute Cloud) developer &#8211; up until this point, hosting web sites on EC2 has been a little tricky due to the fact that EC2 instances used dynamic IPs &#8211; making it tough to set up reliable load balancing and failover in the face of ever-changing IP addresses.</p>
<p>From the email I just received (below), it looks like this may no longer be an issue.  Also in the email is the announcement of  Availability Zones &#8211; groups of EC2 instances in different physical locations and networks, which will help ensure that if your site goes down in one availability zone, your instances in another zone won&#8217;t be affected.</p>
<p>Here&#8217;s the email:</p>
<blockquote><p> Dear Amazon EC2 Developer,<br />
This is a quick note to let you know about some exciting changes with Amazon EC2. We are happy to announce two significant new features &#8211; <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1346">Elastic IP Addresses</a> and <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1347">Availability Zones</a> &#8211; which help you to run reliable web sites and other applications within Amazon EC2.</p>
<p><a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1346">Elastic IP Addresses</a> are static IP addresses designed for dynamic cloud computing, and now make it easy to host web sites, web services and other online applications in Amazon EC2. Elastic IP addresses are associated with your AWS account, not with your instances, and can be programmatically mapped to any of your instances. This allows you to easily recover from instance and other failures while presenting your users with a static IP address.</p>
<p><a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1347">Availability Zones</a> give you the ability to easily and inexpensively operate a highly available internet application. Each Amazon EC2 Availability Zone is a distinct location that is engineered to be insulated from failures in other Availability Zones. Previously, only very large companies had the scale to be able to distribute an application across multiple locations, but now it is as easy as changing a parameter in an API call. You can choose to run your application across multiple Availability Zones to be prepared for unexpected events such as power failures or network connectivity issues, or you can place instances in the same Availability Zone to take advantage of free data transfer and the lowest latency communication.</p>
<p>With these two new features, it now easier than ever for you to isolate your application from common failure scenarios and host high availability web sites in Amazon EC2.</p>
<p>For more information on how to best leverage this new functionality, please see our Feature Guides for <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1346">Elastic IP Addresses</a> and <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1347">Availability Zones</a>.</p>
<p>Sincerely,<br />
The Amazon EC2 Team</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/03/amazon-ec2-now-offers-static-ips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming with Amazon&#8217;s Web Services?  Buy this book.</title>
		<link>http://www.juliesoft.com/2008/03/programming-with-amazons-web-services-buy-this-book/</link>
		<comments>http://www.juliesoft.com/2008/03/programming-with-amazons-web-services-buy-this-book/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 15:05:12 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/2008/03/26/programming-with-amazons-web-services-buy-this-book/</guid>
		<description><![CDATA[I know I&#8217;m going to, just for the cool fish on the cover and the unbelievably long title: Programming Amazon Web Services: S3, EC2, SQS, FPS, and SimpleDB.
Via Amazon Web Services Blog.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fprogramming-with-amazons-web-services-buy-this-book%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fprogramming-with-amazons-web-services-buy-this-book%2F" height="61" width="51" /></a></div><p><a href="http://www.amazon.com/Programming-Amazon-Web-Services-SimpleDB/dp/0596515812/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206535364&amp;sr=8-1"><img src="http://www.juliesoft.com/wp-content/uploads/2008/03/aws.gif" class="float-left" alt="aws.gif" /></a>I know I&#8217;m going to, just for the cool fish on the cover and the unbelievably long title: <a href="http://www.amazon.com/Programming-Amazon-Web-Services-SimpleDB/dp/0596515812/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206535364&amp;sr=8-1">Programming Amazon Web Services: S3, EC2, SQS, FPS, and SimpleDB</a>.</p>
<p>Via <a href="http://aws.typepad.com/aws/2008/03/programming-ama.html">Amazon Web Services Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/03/programming-with-amazons-web-services-buy-this-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Groovy Micro Benchmark Revisited (Groovy is fast&#8230;)</title>
		<link>http://www.juliesoft.com/2008/03/groovy-micro-benchmark-revisited-groovy-is-fast/</link>
		<comments>http://www.juliesoft.com/2008/03/groovy-micro-benchmark-revisited-groovy-is-fast/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 12:27:47 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/2008/03/12/groovy-micro-benchmark-revisited-groovy-is-fast/</guid>
		<description><![CDATA[Alright, no more Groovy posts for a while after this one.  In fact, I hadn&#8217;t planned on posting about this again, but I thought it was worth mention.
From the last post, we saw the following results for parsing an XML dataset with about 450 simple elements in it 1,000 times:

Java: ~9 seconds
Groovy: ~28 seconds [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fgroovy-micro-benchmark-revisited-groovy-is-fast%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fgroovy-micro-benchmark-revisited-groovy-is-fast%2F" height="61" width="51" /></a></div><p><img src="http://www.juliesoft.com/wp-content/uploads/2008/03/medium11.png" class="float-left" alt="Back again…" />Alright, no more Groovy posts for a while after this one.  In fact, I hadn&#8217;t planned on posting about this again, but I thought it was worth mention.</p>
<p>From <a href="http://www.juliesoft.com/2008/03/10/groovy-micro-benchmark/">the last post</a>, we saw the following results for parsing an XML dataset with about 450 simple elements in it 1,000 times:</p>
<ul>
<li>Java: ~9 seconds</li>
<li>Groovy: ~28 seconds (with new results below&#8230;)</li>
</ul>
<p>I decided to rerun the test for Groovy because of <a href="http://www.juliesoft.com/2008/03/09/groovy-is-coming/">a comment John Wilson left on the first post</a>.  He suggested this more concise syntax for the Groovy implementation:</p>
<p><img src="http://www.juliesoft.com/wp-content/uploads/2008/03/sshot-2.png" alt="New Groovy code" /></p>
<p>I reran the same benchmark, and I was very, very surprised at the results:</p>
<ul>
<li>Java: ~9 seconds</li>
<li><strong>Groovy: </strong><strike>~28</strike><strong> </strong><strong>~9 seconds</strong></li>
</ul>
<p>All I can say is wow.  I&#8217;m not sure what is happening differently, but I&#8217;m happy:)</p>
<p>Any ideas what was taking up so much time in <a href="http://www.juliesoft.com/2008/03/09/groovy-is-coming/">the original Groovy implementation</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/03/groovy-micro-benchmark-revisited-groovy-is-fast/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Groovy Micro Benchmark</title>
		<link>http://www.juliesoft.com/2008/03/groovy-micro-benchmark/</link>
		<comments>http://www.juliesoft.com/2008/03/groovy-micro-benchmark/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 03:57:07 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/2008/03/10/groovy-micro-benchmark/</guid>
		<description><![CDATA[Following on from the previous post (and here&#8217;s the last post), here&#8217;s a very quick and dirty, completely unscientific, prone to error, your mileage may vary micro benchmark I did using the code in the last post.
Date set: a String containing roughly 450 XML elements in the form &#60;contact name=&#8221;some name&#8221; email=&#8221;some email&#8221; /&#62;
Methodology: I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fgroovy-micro-benchmark%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fgroovy-micro-benchmark%2F" height="61" width="51" /></a></div><p><img src="http://www.juliesoft.com/wp-content/uploads/2008/03/medium1.png" class="float-left" alt="Groovy Micro Benchmark" />Following on from <a href="http://www.juliesoft.com/2008/03/09/groovy-is-coming/">the previous post</a> (and here&#8217;s <a href="http://www.juliesoft.com/2008/03/12/groovy-micro-benchmark-revisited-groovy-is-fast/">the last post</a>), here&#8217;s a very quick and dirty, completely unscientific, prone to error, your mileage may vary micro benchmark I did using the code in <a href="http://www.juliesoft.com/2008/03/09/groovy-is-coming/">the last post</a>.</p>
<p>Date set: a String containing roughly 450 XML elements in the form &lt;contact name=&#8221;some name&#8221; email=&#8221;some email&#8221; /&gt;</p>
<p>Methodology: I wrote driver programs in both Groovy and Java to run the test.  Here&#8217;s the one from Java (the Groovy one is similar):</p>
<p><img src="http://www.juliesoft.com/wp-content/uploads/2008/03/driver.png" alt="Driver program" /></p>
<p>As you can see from the code, very quick and dirty.  The test iterates 1,000 times and then prints out the time consumed.</p>
<p>I ran the test several times on my laptop (2Ghz, 2GB ram, blah blah blah it doesn&#8217;t really matter here) and here are the general results for total execution time for 1,000 iterations:</p>
<ul>
<li>Java: ~9 seconds</li>
<li>Groovy: ~28 seconds</li>
</ul>
<p>Quite a difference.  I suspect part of that has to do with my inefficiency as a Groovy programmer.  Certainly though, you can see that there is measurable difference in performance.  I wonder what type of XML parser the Groovy implementation uses behind the scenes. The Java implementation uses SAX.  If Groovy were using DOM with XmlSlurper, I could see that making a very large difference.  Any experts care to chime in?</p>
<p>Now, before you decide to write off Groovy, another metric of interest might be seconds required to develop the code.  It was something like this:</p>
<ul>
<li>Java: ~ 1,800 seconds &#8211; roughly 30 minutes. (First I had to decide what XML library I was going to use &#8211; JDOM?  Dom4J? Xstream? Then I had to search and search for documentation on JDOM&#8230;and of course I had to download JDOM, well, that is, I have to add JDOM as a dependency in my Maven pom.xml (after I looked up the current version of JDOM at the ibiblio repo), and rebuild my Eclipse classpath with the new JAR on it, and then figure out how to use the JDOM API&#8230;) I&#8217;ve been writing Java for about 6 years, so I consider myself fairly adept.</li>
<li>Groovy: ~300 seconds &#8211; roughly 5 minutes.  (I had to find the page on the Groovy wiki that explained how to process XML.)  I&#8217;ve been writing Groovy for less than 2 weeks.</li>
</ul>
<p>So there you have it, my quick and dirty, completely unscientific, prone to error, your mileage may vary micro benchmark.</p>
<p>I&#8217;m not one to reserve judgment, so here goes:</p>
<ul>
<li>First, this is just one example.  Comprehensively measuring performance is a complex thing, and this benchmark doesn&#8217;t claim to do that.  There is no such thing as saying &#8220;Groovy is slow&#8221;.</li>
<li>Second, I&#8217;d gladly trade the frustration and time requirement of the Java solution for the easier to read and write Groovy solution.  Servers are cheap.  I&#8217;ll almost always choose to pay the price in $$$ (which I can always get more of) rather than time (which I can never have enough of).</li>
</ul>
<p>Update: here&#8217;s the <a href="http://www.juliesoft.com/2008/03/12/groovy-micro-benchmark-revisited-groovy-is-fast/">final post</a> in this series.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/03/groovy-micro-benchmark/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Groovy is Coming&#8230;</title>
		<link>http://www.juliesoft.com/2008/03/groovy-is-coming/</link>
		<comments>http://www.juliesoft.com/2008/03/groovy-is-coming/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 22:35:38 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://www.juliesoft.com/2008/03/09/groovy-is-coming/</guid>
		<description><![CDATA[I&#8217;ve been trying to slowly integrate some Groovy into my normal Java coding.  Here&#8217;s just one of the reasons why:

Java code:

Groovy code:

Note that this reduction in complexity happens almost everywhere I choose to use Groovy over Java.  Of course there are myriad other ways I could have done this in Java (I even [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fgroovy-is-coming%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F03%2Fgroovy-is-coming%2F" height="61" width="51" /></a></div><p><img src="http://www.juliesoft.com/wp-content/uploads/2008/03/medium.png" class="float-left" alt="Here comes Groovy" />I&#8217;ve been trying to slowly integrate some <a href="http://groovy.codehaus.org/">Groovy</a> into my normal Java coding.  Here&#8217;s just one of the reasons why:</p>
<p><br style="clear: both" /></p>
<p>Java code:<br />
<img src="http://www.juliesoft.com/wp-content/uploads/2008/03/java1.png" alt="The Java code" /></p>
<p>Groovy code:<br />
<img src="http://www.juliesoft.com/wp-content/uploads/2008/03/groovy.png" alt="The Groovy code" /></p>
<p>Note that this reduction in complexity happens almost everywhere I choose to use Groovy over Java.  Of course there are myriad other ways I could have done this in Java (I even tried Xstream but I couldn&#8217;t figure part out so I gave up).  The point is that the first way I chose to do it in Groovy was natural, expressive, and easy.</p>
<p>Groovy is not going away any time soon.  If you&#8217;re a Java developer and wish you could move faster, <a href="http://www.amazon.com/Groovy-Action-Dierk-Koenig/dp/1932394842/ref=pd_bbs_sr_1_s9_rk?ie=UTF8&amp;s=books&amp;s9r=8afd079f0eefbbe9010f873c3e10073b&amp;itemPosition=1&amp;qid=1205101426&amp;sr=8-1">buy the book</a>, read it, and then start integrating Groovy into your daily programming a little at a time. You&#8217;ll be happy you did.</p>
<p>And don&#8217;t even get me started on <a href="http://grails.org/">Grails</a>&#8230;</p>
<p><strong>Update:</strong> here are the <a href="http://www.juliesoft.com/2008/03/10/groovy-micro-benchmark/">second</a> and <a href="http://www.juliesoft.com/2008/03/12/groovy-micro-benchmark-revisited-groovy-is-fast/">third</a> posts in this series (benchmarks included).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/03/groovy-is-coming/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>jQuery &#8211; THE JavaScript library to use?</title>
		<link>http://www.juliesoft.com/2008/02/jquery-the-javascript-library-to-use/</link>
		<comments>http://www.juliesoft.com/2008/02/jquery-the-javascript-library-to-use/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 17:03:20 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://juliesoftllc.virtual.vps-host.net/juliesoft/blog/jon/?p=109</guid>
		<description><![CDATA[Is it me, or does it seem like jQuery has been picking up a lot of steam over the past 6 months or so?
It used to be that when I thought Javascript/AJAX library, I thought Prototype.  Anymore, however, I think jQuery.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F02%2Fjquery-the-javascript-library-to-use%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F02%2Fjquery-the-javascript-library-to-use%2F" height="61" width="51" /></a></div><p><img ALT="jQuery is picking up steam as THE javascript library to use" SRC="http://www.juliesoft.com/wp-content/uploads/2008/02/jquery-logo.gif" CLASS="float-left" />Is it me, or does it seem like <a HREF="http://jquery.com/">jQuery</a> has been <a HREF="http://jquery.com/blog/2008/02/08/jquery-123-air-namespacing-and-ui-alpha/">picking up a lot of steam</a> over the past 6 months or so?</p>
<p>It used to be that when I thought Javascript/AJAX library, I thought <a HREF="http://www.prototypejs.org/">Prototype</a>.  Anymore, however, I think jQuery.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/02/jquery-the-javascript-library-to-use/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Running Jetty from Inside Ant&#8230;or Jetty + Ant = Crazy Delicious</title>
		<link>http://www.juliesoft.com/2008/02/running-jetty-from-inside-antor-jetty-ant-crazy-delicious/</link>
		<comments>http://www.juliesoft.com/2008/02/running-jetty-from-inside-antor-jetty-ant-crazy-delicious/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 01:55:22 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://juliesoftllc.virtual.vps-host.net/juliesoft/blog/jon/?p=104</guid>
		<description><![CDATA[Want to speed up your Java web development?  Read on&#8230;

Jetty is one of the best Java Servlet containers out there.  I still don&#8217;t use it for production deployment (Tomcat has better monitoring capabilities I think), but it&#8217;s all I use for development.  I&#8217;ve also been using Maven 2 a lot lately (although [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F02%2Frunning-jetty-from-inside-antor-jetty-ant-crazy-delicious%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F02%2Frunning-jetty-from-inside-antor-jetty-ant-crazy-delicious%2F" height="61" width="51" /></a></div><p>Want to speed up your Java web development?  Read on&#8230;</p>
<p><img ALT="Jetty and Ant - Like Peanut butter and jetty…err…jelly" SRC="http://www.juliesoft.com/wp-content/uploads/2008/02/jettyant.png" /></p>
<p><a HREF="http://www.mortbay.org/">Jetty</a> is one of the best Java Servlet containers out there.  I still don&#8217;t use it for production deployment (<a HREF="http://tomcat.apache.org/">Tomcat</a> has better monitoring capabilities I think), but it&#8217;s all I use for development.  I&#8217;ve also been using <a HREF="http://maven.apache.org/">Maven 2</a> a lot lately (although I&#8217;ve come to hate it and can&#8217;t wait to migrate back to <a HREF="http://ant.apache.org/">Ant</a>).  One of the reasons I started using Maven was because of the awesome <a HREF="http://www.mortbay.org/maven-plugin/">Jetty Maven plug in</a> &#8211; by running something like &#8220;mvn jetty:run&#8221; on the command line, Maven will start a Jetty instance using your project&#8217;s POM and your web app will be up and running within seconds.  I love it.</p>
<p>However, I hate Maven.</p>
<p>Enter the <a HREF="http://docs.codehaus.org/display/JETTY/Ant+Jetty+Plugin">Jetty Ant plug in</a>.  It does the same thing as the Maven plug in above, except it&#8217;s easier to use, and it works in Ant.</p>
<p>I&#8217;m not going to walk through how to set it up &#8211; you can find that out <a HREF="http://docs.codehaus.org/display/JETTY/Ant+Jetty+Plugin">here</a>.  This is just a heads up to let you know what you&#8217;re missing if you&#8217;re not developing with Jetty and Ant.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/02/running-jetty-from-inside-antor-jetty-ant-crazy-delicious/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon&#8217;s S3, JetS3t, MultiThreadedHttpConnectionManager, and Unable to get a connection</title>
		<link>http://www.juliesoft.com/2008/01/amazons-s3-jets3t-multithreadedhttpconnectionmanager-and-unable-to-get-a-connection/</link>
		<comments>http://www.juliesoft.com/2008/01/amazons-s3-jets3t-multithreadedhttpconnectionmanager-and-unable-to-get-a-connection/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 22:17:36 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://juliesoftllc.virtual.vps-host.net/juliesoft/blog/jon/?p=98</guid>
		<description><![CDATA[Apologies for the long title.
This entry focuses on a recent issue when using Amazon&#8217;s S3 in combination with the popular JetS3t library (version 0.5.0).  If that means absolutely nothing to you, you can stop reading this entry now:D.

Update: Amazon has reverted S3 back to its prior state, completely fixing this issue.
Update: new link added [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F01%2Famazons-s3-jets3t-multithreadedhttpconnectionmanager-and-unable-to-get-a-connection%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F01%2Famazons-s3-jets3t-multithreadedhttpconnectionmanager-and-unable-to-get-a-connection%2F" height="61" width="51" /></a></div><p>Apologies for the long title.</p>
<p>This entry focuses on a recent issue when using <a HREF="http://www.amazon.com/gp/browse.html?node=16427261">Amazon&#8217;s S3</a> in combination with the popular <a HREF="http://jets3t.s3.amazonaws.com/index.html">JetS3t library</a> (version 0.5.0).  If that means absolutely nothing to you, you can stop reading this entry now:D.</p>
<p STYLE="text-align: center"><img ALT="S3" SRC="http://www.juliesoft.com/wp-content/uploads/2008/01/s3.gif" /></p>
<p><strong>Update:</strong> Amazon has reverted S3 back to its prior state, completely fixing this issue.</p>
<p><strong>Update:</strong> new link added at bottom &#8211; a JetS3t developer has contributed an official fix.</p>
<p>On January 11th, <a HREF="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=19024&amp;start=0&amp;tstart=0">Amazon apparently made some changes in S3</a> so that their servers do not explicitly release HTTP connections.  As long as your code is explicitly closing the HTTP connection to S3 (i.e. connection.release()), this shouldn&#8217;t affect you (indeed, most people using S3 weren&#8217;t affected).</p>
<p>However, if you&#8217;re using the JetS3t library, you may have noticed an exception similar to the following after, oh, I don&#8217;t know, exactly 4 uploads to S3:</p>
<p><code>2008-01-13 16:12:55,753 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - HttpConnectionManager.getConnection: config = HostConfiguration[host=https://s3.amazonaws.com], timeout = 0<br />
2008-01-13 16:12:55,753 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - enter HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration)<br />
2008-01-13 16:12:55,753 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - Unable to get a connection, waiting..., hostConfig=HostConfiguration[host=https://s3.amazonaws.com]</code></p>
<p>Why is this happening? It turns out that the REST implementation of JetS3t <a HREF="http://groups.google.com/group/jets3t-users/browse_thread/thread/cff0f96281cad7e7/d2bf06c841a30663?lnk=st&amp;q=#d2bf06c841a30663">doesn&#8217;t explicitly close the HTTP connection after a successful operation</a>.  It also turns out that the max number of connections JetS3t uses <a HREF="http://jets3t.s3.amazonaws.com/toolkit/configuration.html#jets3t">by default is 4</a> (see &#8220;httpclient.max-connections&#8221;).  Thus, once you do 4 uploads to S3, the above error starts appearing (&#8221;error&#8221; is misleading &#8211; I had to turn logging to DEBUG level to get the above message to print out).</p>
<p>The fix is to update the JetS3t RestS3Service.java code to explicitly release the connection, which is exactly what I did (add &#8220;httpMethod.releaseConnection();&#8221; on line 571).  I&#8217;ve attached the code here for those interested.  Note that I haven&#8217;t extensively tested this, and I&#8217;m sure there&#8217;s a better place to call the release method, but this works for now, and is provided on an AS IS basis (NO WARRANTIES &#8211; don&#8217;t hold me or Juliesoft LLC liable for anything that this code breaks).  Hopefully the <a HREF="http://groups.google.com/group/jets3t-users/browse_thread/thread/cff0f96281cad7e7/d2bf06c841a30663?lnk=st&amp;q=#d2bf06c841a30663">JetS3t developers integrate the needed fix</a> into the next version.</p>
<ul>
<li> &#8211; <em>removed &#8211; see update below</em></li>
</ul>
<p><strong>Update: </strong>looks like James Murty, the JetS3t library author, <a HREF="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=19076&amp;tstart=0">has taken care of the issue and posted all of the details</a>.</p>
<p>Because of the post from James, I&#8217;ve removed my versions of the fix and will instead <a HREF="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=19076&amp;tstart=0">direct you to his</a>.</p>
<p>On a side note, I have to say how impressed I am with the Amazon AWS community members, the Amazon staffers moderating the forums, and James Murty &#8211; the amount of communication and the speed of the resolution for this problem make me glad that I&#8217;ve been lucky enough to fall into such an active community!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/01/amazons-s3-jets3t-multithreadedhttpconnectionmanager-and-unable-to-get-a-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Book in March &#8211; Programming Amazon&#8217;s S3, EC2, SQS, and FPS</title>
		<link>http://www.juliesoft.com/2008/01/new-book-in-march-programming-s3-ec2-sqs-and-fps/</link>
		<comments>http://www.juliesoft.com/2008/01/new-book-in-march-programming-s3-ec2-sqs-and-fps/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 13:55:49 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://juliesoftllc.virtual.vps-host.net/juliesoft/blog/jon/?p=92</guid>
		<description><![CDATA[Looks like there&#8217;s going to be a book coming out dedicated to development on Amazon&#8217;s suite of web services &#8211; S3 (Simple Storage Service), EC2 (Elastic Compute Cloud), SQS (Simple Queue Service), and FPS (Flexible Payments Service).

From the the O&#8217;Reilley site:
With this book, you&#8217;ll learn how companies can take advantage of Amazon Web Services (AWS) [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F01%2Fnew-book-in-march-programming-s3-ec2-sqs-and-fps%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2008%2F01%2Fnew-book-in-march-programming-s3-ec2-sqs-and-fps%2F" height="61" width="51" /></a></div><p>Looks like there&#8217;s going to be a <a href="http://www.oreilly.com/catalog/9780596515812/">book</a> coming out dedicated to development on Amazon&#8217;s suite of <a href="http://www.amazon.com/gp/browse.html?node=3435361">web services</a> &#8211; <a href="http://www.amazon.com/S3-AWS-home-page-Money/b/ref=sc_fe_l_2?ie=UTF8&amp;node=16427261&amp;no=3435361&amp;me=A36L942TSJ2AJA">S3 (<strong>S</strong>imple <strong>S</strong>torage <strong>S</strong>ervice)</a>, <a href="http://www.amazon.com/b/ref=sc_fe_l_2?ie=UTF8&amp;node=201590011&amp;no=3435361&amp;me=A36L942TSJ2AJA">EC2 (<strong>E</strong>lastic <strong>C</strong>ompute <strong>C</strong>loud)</a>, <a href="http://www.amazon.com/Simple-Queue-Service-home-page/b/ref=sc_fe_l_2?ie=UTF8&amp;node=13584001&amp;no=3435361&amp;me=A36L942TSJ2AJA">SQS (<strong>S</strong>imple <strong>Q</strong>ueue <strong>S</strong>ervice)</a>, and <a href="http://www.amazon.com/b/ref=sc_fe_l_2?ie=UTF8&amp;node=342430011&amp;no=3435361&amp;me=A36L942TSJ2AJA">FPS (<strong>F</strong>lexible <strong>P</strong>ayments <strong>S</strong>ervice)</a>.</p>
<p style="text-align: center"><a href="http://www.oreilly.com/catalog/9780596515812/"><img src="http://www.juliesoft.com/wp-content/uploads/2008/01/book.gif" alt="Programming S3, EC2, SQS, and FPS" /></a></p>
<p>From the <a href="http://www.oreilly.com/catalog/9780596515812/">the O&#8217;Reilley site</a>:</p>
<blockquote><p>With this book, you&#8217;ll learn how companies can take advantage of Amazon Web Services (AWS) to &#8220;rent&#8221; computing power, data storage and bandwidth on Amazon&#8217;s vast network infrastructure. Programming Web Services gives developers the background and technical detail they need for using Amazon&#8217;s subscription-based Simple Storage Service (S3), Elastic Compute Cloud (EC2), Simple Queue Service (SQS), Flexible Payments Service (FPS), and SimpleDB to build web-scale business applications.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2008/01/new-book-in-march-programming-s3-ec2-sqs-and-fps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trying to Decide on a Payment Processor for Credit Cards on Web Site?</title>
		<link>http://www.juliesoft.com/2007/11/trying-to-decide-on-a-payment-processor-for-credit-cards-on-web-site/</link>
		<comments>http://www.juliesoft.com/2007/11/trying-to-decide-on-a-payment-processor-for-credit-cards-on-web-site/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 00:40:32 +0000</pubDate>
		<dc:creator>Jon Chase</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Java & Programming]]></category>

		<guid isPermaLink="false">http://juliesoftllc.virtual.vps-host.net/juliesoft/blog/jon/?p=82</guid>
		<description><![CDATA[If you&#8217;re going to try to process credit card payments from your web site, you&#8217;ve got a lot of learning to do.  On the one hand, there are the third party providers like PayPal, and there are the merchant account providers like Authorize.net.  If you have no idea what I&#8217;m talking about, have [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.juliesoft.com%2F2007%2F11%2Ftrying-to-decide-on-a-payment-processor-for-credit-cards-on-web-site%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.juliesoft.com%2F2007%2F11%2Ftrying-to-decide-on-a-payment-processor-for-credit-cards-on-web-site%2F" height="61" width="51" /></a></div><p>If you&#8217;re going to try to process credit card payments from your web site, you&#8217;ve got a lot of learning to do.  On the one hand, there are the third party providers like <a HREF="http://www.paypal.com">PayPal</a>, and there are the merchant account providers like <a HREF="http://www.authorize.net">Authorize.net</a>.  If you have no idea what I&#8217;m talking about, have a read of the following articles.</p>
<p><a HREF="http://www.sitepoint.com/article/merchant-account-review">Solve the Payment Processing Problem</a> &#8211; I found this particularly enlightening.  Good description of the differences between a merchant account (like Authorize.net) and a third-party processor (like PayPal).</p>
<p><a HREF="http://www.sitepoint.com/article/money-where-mouse-is-gateways">Put your Money where your Mouse Is: 6 Payment Gateways Reviewed</a> &#8211; This one was great too &#8211; a good review of several payment gateways.</p>
<p STYLE="text-align: center"><img ALT="Chaching" SRC="http://www.juliesoft.com/wp-content/uploads/2007/11/chaching.jpg" /></p>
<p>I&#8217;ve looked further into Authorize.net.  On the plus side, you can do everything through an API, and no &#8220;Pay now with PayPal&#8221; button is required on your site.  It also offers a nice looking package for recurring payments, and even handles trial periods to boot.</p>
<p>As for prices when using a merchant account, they&#8217;re not as clear cut as, say, PayPal is.  There will be some calling around involved and prices are definitely negotiable.</p>
<p>I&#8217;m sure there&#8217;s going to be a lot of leg work involved as I go through the research process, so <a HREF="http://feeds.feedburner.com/Sendalongcom-Blog">subscirbe to the RSS feed</a> to get the updates I post to the blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juliesoft.com/2007/11/trying-to-decide-on-a-payment-processor-for-credit-cards-on-web-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->