JSR 311 - Java REST Libraries
May 29th, 2008 | Published in Web Development | 3 Comments
I’m starting to work on a project at Well.ca using Java and REST. Knowing the amount of REST libraries out there for other languages, I figured there would be a good amount for Java. Wrong!
There is a Java specification currently in draft for REST, it’s called JSR 311. Now the problem with this is that it is still a draft.
There are currently a few implementations of JSR 311:
- Jersey - Part of Glassfish (SUN’s open source JEE server)
- Apache CXF - This was previously XFire, an implementation of SOAP for Java. It has also started to implement JSR 311. I think this implementation isn’t as fully featured as the other implementations.
- RESTeasy - JBoss’s implementation of JSR 311.
There are a few other options for REST and Java. One option that has been around for a while is called Restlet. The creator of Restlet is involved in the writing of JSR 311 but I don’t believe his project implements JSR 311. Update[11-Jun-08]: As commented below by Jerome Louvel and Stephan Koops there is an extension to Restlet to implement JSR 311, more information can be found on the Restlet Wiki.
Currently, I’m using Apache CXF for my project. But I’m hoping to move to Jersey or RESTeasy because they have a more complete implementation.
The problem with Jersey is that it doesn’t play nice with Hibernate and Maven. This is caused by Hibernate requiring cglib which requires ASM 1.5.3, while Jersey requires ASM 3. There are a few solutions described on the web, but they haven’t solved the problem for me. I’m hoping to work on this at some point, once I find a solution (if I do) then I’ll post it.

May 30th, 2008 at 1:07 am (#)
In Restlet, there is an implementation of JAX-RS (JSR-311) that is built on top of the Restlet API, which is in itself a quite stable and complete solution.
See more details here:
http://wiki.restlet.org/docs_1.1/g1/13-restlet/28-restlet/57-restlet.html
Best regards,
Jerome
June 10th, 2008 at 10:29 am (#)
Hi Chris,
also Restlet gets an JAX-RS implementation. See http://stephankoo.wordpress.com/ and htp://www.restlet.org
June 10th, 2008 at 4:17 pm (#)
Thanks Jerome and Stephan. I didn’t know there was such an implementation. I’ll take a look into it. At first look, I liked Restlet, but I felt it would be wiser to go with the standards.