<?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>java rants &#187; json</title> <atom:link href="http://www.javarants.com/tag/json/feed/" rel="self" type="application/rss+xml" /><link>http://www.javarants.com</link> <description>Rants about Java and other internet technologies by Sam Pullara</description> <lastBuildDate>Sun, 09 Oct 2011 23:29:31 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>Using JAX-RS (Jersey) to build a JPA/JAXB-backed JSON REST API</title><link>http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/</link> <comments>http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/#comments</comments> <pubDate>Fri, 26 Dec 2008 01:38:46 +0000</pubDate> <dc:creator>Sam Pullara</dc:creator> <category><![CDATA[Java]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[hibernate]]></category> <category><![CDATA[jax-rs]]></category> <category><![CDATA[jersey]]></category> <category><![CDATA[jpa]]></category> <category><![CDATA[json]]></category> <category><![CDATA[jsr-311]]></category> <category><![CDATA[openjpa]]></category> <category><![CDATA[orm]]></category> <category><![CDATA[rest]]></category> <category><![CDATA[toplink]]></category> <category><![CDATA[xml]]></category> <guid
isPermaLink="false">http://www.javarants.com/?p=926</guid> <description><![CDATA[I've been looking for a while though to find that perfect combination of frameworks and libraries that would give me the expressive power that I want for building web applications -- now I think I've found it. <a
href="http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Building applications for deployment to the web has evolved over the last several years to be focused on dynamic behavior, separation of model/view/controller, and simplified but scalable configuration and deployment.  From a performance, tools and library perspective I&#8217;m still highly biased to development in Java over more up-and-coming languages.  However, much has been learned in the Java community from the better frameworks like Rails and those lessons should not be ignored.</p><p>I&#8217;ve been looking for a while though to find that perfect combination of frameworks and libraries that would give me the expressive power that I want for building web applications.  There have been many contenders from <a
href="http://wiki.jruby.org/wiki/JRuby_on_Rails">JRuby on Rails</a>, to <a
href="http://grails.org/">Grails</a>, to <a
href="http://seamframework.org/">Seam</a> and even just writing everything myself.  Ultimately, I believe in the <a
href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a> principle (like Rails), though I don&#8217;t think many frameworks go far enough when dealing with the database.  When you are building a web application it is rare that you are going to change what database you are using.  In fact, the majority of your scaling architecture is likely highly dependent on how you store your data.  This is why I prefer an application framework that allows me to start with the database and construct my application&#8217;s data object model from it.<br
/> <span
id="more-926"></span><br
/> So what are my acceptance criteria for this über-framework?</p><ul><li>Great object-relational mapping tool that works well with MySQL + PostgreSQL</li><li>Excellent support for consuming and producing XML and JSON that integrates with the well with the data objects that the ORM tool uses</li><li>Supports writing MVC applications naturally</li><li>Support for building REST APIs with arbitrary URL mapping to service parameters</li><li>High straight-line performance with the ability to scale up servers</li><li>Great defaults that make configuration mostly unnecessary with simple deployment</li><li><a
href="http://www.jetbrains.com/idea/">State-of-the-art IDE support</a>. I don&#8217;t like to type anymore nor memorize APIs.</li><li>Suitable for quick prototyping and production applications</li><li>Support for templating views of any output type (HTML, XML, etc)</li><li>Easy to unit and integration test</li><li>Open source</li></ul><p>Certainly a high barrier but I think I have finally found one that is a very strong contender. Amazingly, it is even coming out of the JSR standards process with a nice layer of open source on top of it.  <a
href="http://jcp.org/en/jsr/detail?id=311">JSR-311</a> was stated to develop an API for providing support for <a
href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> Web Services in the Java Platform.  Not only does it do that nicely but it also has the right hooks for simple dependency injection, orthogonal to <a
href="http://www.jcp.org/en/jsr/detail?id=220">JPA</a> (my favorite ORM), support for both XML and JSON natively, and except in unusual circumstances very DRY.</p><p>Because it is in Java and works well with JPA it satisfies a large number of my requirements before we even look at what it offers.  Another aspect of it that didn&#8217;t make the above list is that the production quality reference implementation is available as a couple of dependencies in Maven making it very easy to work with.  It also works well deployed within lightweight containers like <a
href="https://grizzly.dev.java.net/">Grizzly</a>, heavier ones like <a
href="http://tomcat.apache.org/">Tomcat</a> and <a
href="https://glassfish.dev.java.net/">Glassfish</a>, and the REST APIs it creates can even be directly tested without any container at all. There are some things that Jersey supports that are non-standard that I think are excellent additions to the framework and should likely make it into future versions including support for templating (like JSP and Freemarker) that help it satisfy my requirements.</p><p>To give you an example of how terse the API can be, here is the simplest example that includes deployment as an operating web service:</p><pre>
<span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">class</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> Main {
    </span><span style="color: rgb(128,128,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">@Path</span><span style="color: rgb(0,0,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); background-color: rgb(246,235,188); font-weight: bold; font-style: normal; ">&quot;/helloworld&quot;</span><span style="color: rgb(0,0,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">)</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">static</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">class</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> HelloWorldResource {
        </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@GET</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
        </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Produces</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;text/plain&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
        </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> String getClichedMessage() {
            </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">return</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;Hello World&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">;
        }
    }
    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">static</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">void</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> main(String[] args) </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">throws</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> IOException {
        Map&lt;String, String&gt; initParams = </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">new</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> HashMap&lt;String, String&gt;();
        initParams.put(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;com.sun.jersey.config.property.packages&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, </span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;com.sun.jersey.samples.helloworld&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">);
        System.</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: italic; ">out</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.println(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;Starting grizzly...&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">);
        URI uri = UriBuilder.</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: italic; ">fromUri</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;http://localhost/&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">).port(</span><span style="color: rgb(0,0,255); font-weight: normal; font-style: normal; ">9998</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">).build();
        SelectorThread threadSelector = GrizzlyWebContainerFactory.</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: italic; ">create</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(uri, initParams);
        System.</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: italic; ">out</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.println(String.</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: italic; ">format</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;Try out %shelloworld</span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">\n</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">Hit enter to stop it...&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, uri));
        System.</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: italic; ">in</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.</span><span style="color: rgb(0,0,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">read</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">();
        threadSelector.stopEndpoint();
    }
}
</span>
</pre><p>The @Path annotation lets you use URI path templates to specify the matching paths and path parameters to your REST service.  You can produce any set of content-types and content negotiation will be done for you based on the incoming request.  Exceptions can be mapped directly to error responses.  Query, Matrix, Path, Header and Cookie parameters are all supported and automatically injected based on annotations.  Here is a more sophisticated example from an application I am writing:</p><pre>
<span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@GET</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Produces</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;application/json&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Path</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;/network/{id: [0-9]+}/{nid}&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> User getUserByNetworkId(</span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@PathParam</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;id&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">) </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">int</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> id, </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@PathParam</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;nid&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">) String networkId) {
        Query q = </span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.createQuery(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;</span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">SELECT</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> u </span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">FROM</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> User u </span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">WHERE</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> u.networkId = :id </span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">AND</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> u.networkUserId = :nid</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">);
        q.setParameter(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;id&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, id);
        q.setParameter(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;nid&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, networkId);
        </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">return</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> (User) q.getSingleResult();
    }</span>
</pre><p>In this example we are implementing a GET request with two path parameters, id and uid.  They are automatically passed into the method on execution and then I use them in a JPA statement.  EntityNotFoundException is actually mapped to a 404 but I don&#8217;t need to deal with that in the method itself.  PUTs and POSTs are similarly straight-forward.  This method creates a new user:</p><pre>
<span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@PUT</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Consumes</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;application/json&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Produces</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;application/json&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Path</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;/create&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> User createUser(User user) {
        user.setNetwork(</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.getReference(Network.</span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">class</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, user.getNetworkId()));
        </span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.persist(user);
        </span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.refresh(user);
        </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">return</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> user;
    }</span>
</pre><p>All very declarative and readable. And works great with JPA objects that also happen to be JAXB objects.  Notice that in those examples I am returning JSON but I don&#8217;t need to explicitly convert my objects.  All that is handled by built in message readers and writers (which can be extended if need be).</p><p>One thing that I will note is that after struggling with both <a
href="http://openjpa.apache.org/">OpenJPA</a> (less than ideal support for the standard) and <a
href="http://hibernate.org">Hibernate</a> (some very odd runtime class munging) I settled with <a
href="http://oss.oracle.com/toplink-essentials-jpa.html">Toplink-Essentials</a> (the open-source version of Oracle Toplink).  It is much more robust than OpenJPA and is much cleaner at runtime than Hibernate.  Finally here is what a typical Maven dependencies look like for creating a Jersey-based web application:</p><pre>
<span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repositories</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">maven2-repository.dev.java.net</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">name</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">Java.net</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">Repository</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">for</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">Maven</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">name</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">http://download.java.net/maven/2</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">java.net</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">http://download.java.net/maven/1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">layout</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">legacy</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">layout</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repositories</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependencies</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">com.sun.jersey</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">jersey-server</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">1.0.1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">com.sun.jersey</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">jersey-json</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">1.0.1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">com.sun.jersey</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">jersey-atom</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">1.0.1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">mysql</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">mysql-connector-java</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">5.1.6</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">toplink.essentials</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">toplink-essentials</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">2.1-60</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependencies</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
</span>
</pre><p>I was very impressed with how little it took to get going, especially with <a
href="http://www.jetbrains.com/idea/download/">IntelliJ 8.0</a>&#8216;s awesome support for reading pom.xml files.  So now I&#8217;m a few days into building the application I set out to build and things are going great.  I haven&#8217;t hit any roadblocks so far and I&#8217;ve planned pretty far out already so I don&#8217;t expect to.  Though, with Jersey&#8217;s extensibility API, I think that if I do run into anything I have a great escape valve for augmenting the framework.  I&#8217;m not associated with Jersey or the JSR-311 specification but I might have to join in the fun.  This framework looks like it will have long legs in the Java community.</p> ]]></content:encoded> <wfw:commentRss>http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Using Google App Engine to Extend Yahoo! Pipes</title><link>http://www.javarants.com/2008/04/13/using-google-app-engine-to-extend-yahoo-pipes/</link> <comments>http://www.javarants.com/2008/04/13/using-google-app-engine-to-extend-yahoo-pipes/#comments</comments> <pubDate>Mon, 14 Apr 2008 02:59:45 +0000</pubDate> <dc:creator>Sam Pullara</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[google]]></category> <category><![CDATA[google app engine]]></category> <category><![CDATA[googleappengine]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[json]]></category> <category><![CDATA[pipes]]></category> <category><![CDATA[python]]></category> <category><![CDATA[web service]]></category> <category><![CDATA[yahoo]]></category> <category><![CDATA[yahoo pipes]]></category> <guid
isPermaLink="false">http://www.javarants.com/?p=871</guid> <description><![CDATA[Update: A commenter pointed out that you can from django.utils import simplejson instead of including it. Makes this even easier. Yahoo! Pipes has always been a great tool for manipulating data but often you have to go to great contortions &#8230; <a
href="http://www.javarants.com/2008/04/13/using-google-app-engine-to-extend-yahoo-pipes/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Update: A commenter pointed out that you can<pre>from django.utils import simplejson</pre><p> instead of including it.  Makes this even easier.</p><p><a
href="http://pipes.yahoo.com">Yahoo! Pipes</a> has always been a great tool for manipulating data but often you have to go to great contortions to get it to do what you want because of its very simple data flow programming model.  <a
href="http://appengine.google.com">Google&#8217;s App Engine </a>opens up the possibility of extending Yahoo! Pipes in very interesting ways through Pipes&#8217; Web Service operator.  Currently this operator sees little use as it requires you to be running an external server somewhere on the internet that is always available for the Pipe execution which is quite a high barrier to entry for the typical Pipes developer. Here is what a Pipe that is using web service looks like and our example pipe:</p><p><a
title="Web Services Example Pipe" href="http://pipes.yahoo.com/spullara/mirror"><img
src="http://buildandtest.com/files/pipeusingwebservice.png" alt="Web Service Pipes Example" width="676" height="585" /></a> </p><p>With the launch of Google App Engine there is now a very simple way to get code up on the internet quickly in order to include arbitrary processing in the interior of your Pipes.</p><p>To demonstrate how this works, let&#8217;s first build a very simple web service that simply mirrors the data that it receives from Pipes.   If you don&#8217;t have a Google App Engine account you can still follow along by download the <a
href="http://code.google.com/appengine/">SDK</a> and executing all the stuff locally though it will have to be accessible from the public internet if you want Pipes to send you requests.</p><p>First create a new application directory:</p><pre>mkdir pipes-mirror
cd pipes-mirror </pre><p>Now create an application descriptor called app.yaml:</p><pre style="line-height: 100%;font-family:monospace;background-color:#ffffff; border-width:0.01mm; border-color:#000000; border-style:solid; padding:4px;"><span style="background-color:#ffffff;">application: javarants
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
  script: pipes.py</span></pre><p>This application descriptor basically tells Google how to deploy your application.  Your application name should match an application name that you create within the GAE administration tool:</p><p><img
src="http://buildandtest.com/files/applicationname.png" alt="Application Name" width="495" height="161" /></p><p>Now we need to process the data coming from pipes.  Pipes is going to pass this web service some data in JSON format and we need to parse it.  GAE doesn&#8217;t include &#8216;<code>simplejson</code>&#8216; in the Python container so you are going to have to include it with your application.  I downloaded <a
href="http://pypi.python.org/pypi/simplejson">simplejson-1.8.1</a> and symbolically linked its <code>simplejson</code> directory into my application directory.  When the request comes in the JSON data will be in the &#8216;<code>data</code>&#8216; parameter so we are going to pull it out, parse it, grab the <code>items</code> array and write it back over the wire in pipes.py:</p><pre style="line-height: 100%;font-family:monospace;background-color:#ffffff; border-width:0.01mm; border-color:#000000; border-style:solid; padding:4px;"><span style="color:#000080;background-color:#ffffff;font-weight:bold;">import</span><span style="background-color:#ffffff;"> simplejson
</span><span style="color:#000080;background-color:#ffffff;font-weight:bold;">import</span><span style="background-color:#ffffff;"> wsgiref.handlers
</span><span style="color:#000080;background-color:#ffffff;font-weight:bold;">from</span><span style="background-color:#ffffff;"> google.appengine.ext </span><span style="color:#000080;background-color:#ffffff;font-weight:bold;">import</span><span style="background-color:#ffffff;"> webapp
</span><span style="color:#000080;background-color:#ffffff;font-weight:bold;">class</span><span style="background-color:#ffffff;"> MirrorPipesWebService (webapp.RequestHandler):
	</span><span style="color:#000080;background-color:#ffffff;font-weight:bold;">def</span><span style="background-color:#ffffff;"> post(self):
		data = self.request.get(</span><span style="color:#008000;background-color:#ffffff;font-weight:bold;">"data"</span><span style="background-color:#ffffff;">)
		obj = simplejson.loads(data)
		obj = obj[</span><span style="color:#008000;background-color:#ffffff;font-weight:bold;">"items"</span><span style="background-color:#ffffff;">]
		self.response.content_type = </span><span style="color:#008000;background-color:#ffffff;font-weight:bold;">"application/json"
</span><span style="background-color:#ffffff;">		simplejson.dump(obj, self.response.out)
</span><span style="color:#000080;background-color:#ffffff;font-weight:bold;">def</span><span style="background-color:#ffffff;"> main():
  application = webapp.WSGIApplication([(</span><span style="color:#008000;background-color:#ffffff;font-weight:bold;">'/mirror'</span><span style="background-color:#ffffff;">, MirrorPipesWebService)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)
</span><span style="color:#000080;background-color:#ffffff;font-weight:bold;">if</span><span style="background-color:#ffffff;"> __name__ == </span><span style="color:#008000;background-color:#ffffff;font-weight:bold;">"__main__"</span><span style="background-color:#ffffff;">:
  main()</span></pre><p>Now you should have a directory structure that looks a lot like this:</p><pre>-rw-r--r--@ 1 sam  sam  106 Apr 13 18:55 app.yaml
-rw-r--r--  1 sam  sam  559 Apr 13 19:28 pipes.py
lrwxr-xr-x  1 sam  sam   47 Apr 13 17:40 simplejson -&gt; /Users/sam/Software/simplejson-1.8.1/simplejson</pre><p>Now that we have all the pieces we can deploy the application to GAE with a simple command from the GAE SDK:</p><pre>appcfg.py update .</pre><p>At this point you should be able to replace my <a
href="http://javarants.appspot.com/mirror">web service URL</a> that you find in my example Pipe with your application URL which will be<pre>http://[application name].appspot.com/mirror</pre><p> and get the same results as mine.</p><p>What kind of uses can you put this great power?  I currently have a web service that I run that combines RSS entries from the same day into a single entry and have it deployed on my own server.  I will likely port that to GAE as it doesn&#8217;t require a lot of CPU and it is a pain having to administer it.  In fact, most of the functionality that you see in a service like <a
href="http://feedburner.com">FeedBurner</a> would be easy to build on top of this framework.  More exotic use cases can be found on Y! Pipes itself where at least one person uses web services to pass in <a
href="http://pipes.yahoo.com/pipes/pipe.info?_id=qKDcUk1r3BGBg4HtODY80A">photo URLs and return the coordinates of human faces</a> in the images.</p> ]]></content:encoded> <wfw:commentRss>http://www.javarants.com/2008/04/13/using-google-app-engine-to-extend-yahoo-pipes/feed/</wfw:commentRss> <slash:comments>34</slash:comments> </item> </channel> </rss>
