<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Always improving...</title>
	<atom:link href="http://sphericalimprovement.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sphericalimprovement.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 01 May 2010 18:22:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sphericalimprovement.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Always improving...</title>
		<link>http://sphericalimprovement.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sphericalimprovement.wordpress.com/osd.xml" title="Always improving..." />
	<atom:link rel='hub' href='http://sphericalimprovement.wordpress.com/?pushpress=hub'/>
		<item>
		<title>request.raw_post returns nil on Glassfish v3</title>
		<link>http://sphericalimprovement.wordpress.com/2010/05/01/request-raw_post-returns-nil-on-glassfish-v3/</link>
		<comments>http://sphericalimprovement.wordpress.com/2010/05/01/request-raw_post-returns-nil-on-glassfish-v3/#comments</comments>
		<pubDate>Sat, 01 May 2010 18:16:31 +0000</pubDate>
		<dc:creator>Mike Bowler</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://sphericalimprovement.wordpress.com/?p=32</guid>
		<description><![CDATA[We&#8217;ve recently moved some rails applications from Glassfish V2 (using warble) to Glassfish V3 running natively.  For the most part, this has been remarkably painless and things have &#8220;just worked&#8221;. Code related to processing REST web services has not just &#8230; <a href="http://sphericalimprovement.wordpress.com/2010/05/01/request-raw_post-returns-nil-on-glassfish-v3/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sphericalimprovement.wordpress.com&amp;blog=3670000&amp;post=32&amp;subd=sphericalimprovement&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve recently moved some rails applications from Glassfish V2 (using  warble) to Glassfish V3 running natively.  For the most part, this has  been remarkably painless and things have &#8220;just worked&#8221;.</p>
<p>Code  related to processing REST web services has not just worked and took  quite a bit of investigation to fix so I&#8217;m documenting it here.</p>
<p>We  process REST calls in rails by calling request.raw_post() on a POST or  PUT request to return the XML payload and then doing some processing on  it.  In Glassfish V2 and every other ruby implementation I tried, this  just works fine.  In Glassfish V3, raw_post() was sometimes returning  nil rather than the actual content of the http request.</p>
<p>After much  investigation, we determined that if the incoming POST or PUT has a  content type of &#8220;text/xml&#8221; then raw_post() will return the correct  content.  If it has a different content type then raw_post() will return  nil.  In our case we weren&#8217;t explicitly setting the content type and so  it was failing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sphericalimprovement.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sphericalimprovement.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sphericalimprovement.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sphericalimprovement.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sphericalimprovement.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sphericalimprovement.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sphericalimprovement.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sphericalimprovement.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sphericalimprovement.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sphericalimprovement.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sphericalimprovement.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sphericalimprovement.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sphericalimprovement.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sphericalimprovement.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sphericalimprovement.wordpress.com&amp;blog=3670000&amp;post=32&amp;subd=sphericalimprovement&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sphericalimprovement.wordpress.com/2010/05/01/request-raw_post-returns-nil-on-glassfish-v3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a966b9ce0a0393c01096bfdc00dd9b0f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mbowler</media:title>
		</media:content>
	</item>
		<item>
		<title>SOAP Web services in a Java EE 5 world</title>
		<link>http://sphericalimprovement.wordpress.com/2009/01/02/soap-web-services-in-a-java-ee-5-world/</link>
		<comments>http://sphericalimprovement.wordpress.com/2009/01/02/soap-web-services-in-a-java-ee-5-world/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 14:21:55 +0000</pubDate>
		<dc:creator>Mike Bowler</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[java glassfish webservices jsr181]]></category>

		<guid isPermaLink="false">http://sphericalimprovement.wordpress.com/?p=22</guid>
		<description><![CDATA[SOAP web services in Java have traditionally been far more trouble than they&#8217;ve been worth.  The old model of generating stubs and tweaking configuration files was sufficiently painful that it made the whole process very unpleasant. In Java EE 5, &#8230; <a href="http://sphericalimprovement.wordpress.com/2009/01/02/soap-web-services-in-a-java-ee-5-world/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sphericalimprovement.wordpress.com&amp;blog=3670000&amp;post=22&amp;subd=sphericalimprovement&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SOAP web services in Java have traditionally been far more trouble than they&#8217;ve been worth.  The old model of generating stubs and tweaking configuration files was sufficiently painful that it made the whole process very unpleasant.</p>
<p>In Java EE 5, most of this pain has disappeared; at least for simple web services.  JSR-181 defines annotations for web services that remove most of the complexity.  For example&#8230;</p>
<pre style="padding-left:30px;">import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public class SimpleWebService {

    @WebMethod
    public String doIt(String message) {
        return "got "+message;
    }
}</pre>
<p>In this sample, when the WAR (or EAR) file is deployed to the server, the container will scan for the @WebService annotation and will automatically deploy this as a web service.  I use glassfish v2 for this and it works seamlessly.</p>
<p>Oh, there&#8217;s still one gotcha of course.  The container will only scan for the annotations if it thinks this is a Java EE 5 application.  To make sure that it knows that, you have to ensure that your web.xml has the appropriate version attribute on it.  The one I&#8217;m using for the sample above is this&#8230;</p>
<pre style="padding-left:30px;">&lt;web-app <strong>version="2.5"</strong>
  xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;

  &lt;session-config&gt;
    &lt;session-timeout&gt;30&lt;/session-timeout&gt;
  &lt;/session-config&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
&lt;/web-app&gt;</pre>
<p>So what if you&#8217;re using maven to do your builds like I do?  A quick google search will turn up lots of advice on how you need to install the jaxws-maven-plugin and add it to your build process so that it generates all kinds of pieces.  This is great if you&#8217;re using older web services but is completely unnecessary in Java EE 5.  The only thing you need to do with maven is add dependencies for the Java EE 5 api&#8217;s</p>
<pre style="padding-left:30px;">&lt;dependency&gt;</pre>
<pre style="padding-left:30px;">    &lt;groupId&gt;javax.xml.ws&lt;/groupId&gt;</pre>
<pre style="padding-left:30px;">    &lt;artifactId&gt;jaxws-api&lt;/artifactId&gt;</pre>
<pre style="padding-left:30px;">    &lt;version&gt;2.1-1&lt;/version&gt;</pre>
<pre style="padding-left:30px;">    &lt;scope&gt;provided&lt;/scope&gt;</pre>
<pre style="padding-left:30px;">&lt;/dependency&gt;</pre>
<p>You want the scope to be &#8220;provided&#8221; so that this jar doesn&#8217;t get packaged into your war file.  And that&#8217;s it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sphericalimprovement.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sphericalimprovement.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sphericalimprovement.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sphericalimprovement.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sphericalimprovement.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sphericalimprovement.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sphericalimprovement.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sphericalimprovement.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sphericalimprovement.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sphericalimprovement.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sphericalimprovement.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sphericalimprovement.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sphericalimprovement.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sphericalimprovement.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sphericalimprovement.wordpress.com&amp;blog=3670000&amp;post=22&amp;subd=sphericalimprovement&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sphericalimprovement.wordpress.com/2009/01/02/soap-web-services-in-a-java-ee-5-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a966b9ce0a0393c01096bfdc00dd9b0f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mbowler</media:title>
		</media:content>
	</item>
		<item>
		<title>The story so far&#8230;</title>
		<link>http://sphericalimprovement.wordpress.com/2009/01/02/the-story-so-far/</link>
		<comments>http://sphericalimprovement.wordpress.com/2009/01/02/the-story-so-far/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 01:31:11 +0000</pubDate>
		<dc:creator>Mike Bowler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sphericalimprovement.wordpress.com/?p=12</guid>
		<description><![CDATA[About four years ago, I started a blog at my own domain of sphericalimprovement.com.  No need to link since it isn&#8217;t there anymore. I wrote to that blog in bursts over the four years and accumulated a decent amount of &#8230; <a href="http://sphericalimprovement.wordpress.com/2009/01/02/the-story-so-far/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sphericalimprovement.wordpress.com&amp;blog=3670000&amp;post=12&amp;subd=sphericalimprovement&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>About four years ago, I started a blog at my own domain of sphericalimprovement.com.  No need to link since it isn&#8217;t there anymore.</p>
<p>I wrote to that blog in bursts over the four years and accumulated a decent amount of content.  Lots of technical content on programming and agile development practices interspersed with other things that caught my interest.</p>
<p>In order to lower my hosting costs, I&#8217;d wanted to move that blog to one of the free services like this one (WordPress) but it wasn&#8217;t easy to migrate from the blog software I was using and there was always something more important on my todo list.</p>
<p>Recently, that blog got hacked and subsequently wiped by the hosting company it was at.  They had backups but it would have been a lot of work to secure the site and get it up and running again so I made the call to just let it go.</p>
<p>I&#8217;d thought that I&#8217;d just let blogging go entirely but I&#8217;m finding that more difficult than I&#8217;d thought.  Situations are coming up that I want to blog about and I&#8217;m finding it frustrating that I don&#8217;t have a place to write about these things anymore.  So here we are again.  This is a new blog with none of the old content.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sphericalimprovement.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sphericalimprovement.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sphericalimprovement.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sphericalimprovement.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sphericalimprovement.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sphericalimprovement.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sphericalimprovement.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sphericalimprovement.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sphericalimprovement.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sphericalimprovement.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sphericalimprovement.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sphericalimprovement.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sphericalimprovement.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sphericalimprovement.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sphericalimprovement.wordpress.com&amp;blog=3670000&amp;post=12&amp;subd=sphericalimprovement&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sphericalimprovement.wordpress.com/2009/01/02/the-story-so-far/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a966b9ce0a0393c01096bfdc00dd9b0f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mbowler</media:title>
		</media:content>
	</item>
	</channel>
</rss>
