This Week in Spring - June 26th, 2012

Engineering | Josh Long | June 27, 2012 | ...
<P> What a week! So much to talk about and scarcely enough minutes in the day to manage.   
Without any further ado, let's get on to it!	</P> 
  1. Jonathan Brisbin has announced the availability of Spring Data REST 1.0.0.RC1 . Spring Data REST helps you provide a RESTful interface for your JPA-based repositories.
  2. Oliver Gierke has announced Spring Data MongoDB 1.0.2.GA. The new release has plenty of bugfixes and improvements, so check the changelog for more.
  3. Wonder what happened to the RabbitMQ webinar that was briefly on the SpringSource events calendar? It was rescheduled (slight schedule mishap), but it's back and you should definitely mark your calendars with the updated dates. It figures to be an amazing event.
  4. Our pal Gordon Dickens - a world class trainer and engineer - has been very busy recently.
    	 If you haven't been following his blog recently, you missed an 
    	  <a href =""> introduction to the SpringSource Tool Suite  -  including its composition and value-added features,  and  answers some common questions</A>.
    		 Besides the great post <a href= "">on Spring 3.1's constructor namespace…

This Week in Spring - June 19th, 2012

Engineering | Josh Long | June 19, 2012 | ...
<P> This week the I'm at QCon New York talking to people about Spring, Cloud Foundry,  vFabric, and  much more. Attendees at QCon conferences always keep things interesting with great questions and ideas.  

As usual, though, the internet has given us a lot of great content to look at this last week, so let's dive right into the roundup!

  1. If you missed Gary Russell's excellent webinar introducing managing and monitoring of Spring Integration applications, don't worry, the video is on the SpringSource YouTube channel.
  2.  <LI>  Details of the new  release of <a href = "">Spring for Apache Hadoop 1.0.0.M2</A> are available. For information on the project itself, check out this  <a href = "…

Highlights of Spring for Apache Hadoop 1.0.0 M2

Engineering | Costin Leau | June 13, 2012 | ...

I am happy to announce that the second milestone (1.0.0.M2) of Spring for Apache Hadoop project is available. In this blog post, I would like to quickly highlight the major new features in M2.

HBase DAO support

One of the most versatile and powerful feature in Spring Framework is the Data Access Object (or DAO) support. With Spring for Hadoop 1.0.0 M2, the same functionality was added for HBase. Users of the popular template and callback pattern should feel right at home as the framework handles the table lookup, resource cleanup and exception conversion, letting the developer focus on what really matters. See the API and reference docs for more information. By the way, we also included a new sample in the distribution, hbase-crud, to help you get started right away.

Cascading Taps

In M2, we have expanded the integration with Cascading library by Taps for Spring Framework and Spring Integration resources. The richness of Spring Integration adapters (whether inbound or outbound) such as File, TCP, Twitter, FTP, RSS (just to name a few) is now available to Cascading (and its extensions such as Cascalog or Scalding). And we are just getting started - expect more news on this front.

Hadoop Security

With M2, moving from a vanilla Hadoop install (such as a dev machine) to a fully Kerberos-secured Hadoop cluster is transparent. The File-System, Map/Reduce and Pig components are all security-aware, executing under proper credentials and supporting user impersonation. See the dedicated chapter for more information.

Enhanced vanilla Map/Reduce support

Since the beginning, Spring for Apache Hadoop offered extensive support for Map/Reduce jobs - whether it is vanilla or traditional Java Map/Reduce, streaming or tooling. In M2, we have added support for Hadoop generic options across the board, making job provisioning, either by naming resources individually or through pattern matching, a one-liner. Further more, we have enhanced the bootstrapping of jar-based jobs - rather then requiring the classes to be on the classpath, the job can be fully loaded, in isolation, from the jar. The classes (and their dependencies) do not leak into the application which avoids all sorts of versioning conflicts and dependency creep. The tool declaration has been improved to automatically read the Jar metadata and its Main-Class, offering a powerful, fully managed replacement to Hadoop shell jar invocations.

Two New Samples

Last but not least, two new samples have been added to the distribution: hbase-crud, which I mentioned before showcasing the declarative and programmatic HBase support and pig-scripting, demoing the JVM and Pig scripting: the former doing data preparations in HDFS for the latter, which does data analysis. There are more samples in the pipeline and if you would like to see anything in particular, tell us.

I hope you enjoy this new milestone. Go ahead, grab 1.0.0 M2, take it for a spin and let us know what you think!

Other News: Project Serengeti

As far as new releases go, Spring for Apache Hadoop 1.0.0 M2 is not the only news on the Hadoop front. Today, VMware takes the curtains off project Serengeti, for virtualized and Highly Available Hadoop. See Richard McDougall's blog post on the motivations behind it, the current status…

This Week in Spring - June 12th, 2012

Engineering | Josh Long | June 13, 2012 | ...

Welcome back to another installment of This Week in Spring. We've got a lot to cover this week, so let's get to it!

  1. Gordon Dickens is at it again, this time with a great look at Spring 3.1's constructor namespace, which provides the logical counterpart to the p: namespace element.
  2. Matt Vickery's at it again! He's got an interesting post on how to use the C24 iO product with Spring.
  3. The Vaadin blog has an interesting post on serialization with the Vaadin web framework and Spring.
  4. The Java Code Geeks has a blog post on using the RESTEasy REST framework with Spring-based services. While I would recommend the Spring REST support in Spring MVC over this approach, it's at least interesting to have the recipe if you ever need to use it.
  5. The Java Code Geeks blog has another post on building Spring-based JPA services that sit behind a RESTful CXF backend. This is another one of those situations where, while it's useful to know how to do in case you need to, you're better off using Spring MVC's REST support. It's easier, and integrates more naturally with the component model.
  6. The Banging My Head Against a Wall blog has a great post on Upgrading from Spring 2.5 to 3.1. This blog shows that the migration is dead simple, if you haven't already made the jump, and he's got insight into one particular little gotcha you might hit to make the migration that much smoother.
  7. The TeamExtension blog has a quick post introducing how to get started with Spring Mobile 1.0. They recommend stock Eclipse with the m2e support, but of course, if you use the SpringSource Tool Suite, you won't have to set anything up.
  8. Are you a .NET developer looking for a solid dependency injection framework like Spring? Have you heard about Spring.NET, the dependency injection framework from the same people behind SpringSource? Blogger Łukasz Budnik has an interesting post about Spring.NET's superiority over other alternatives in the space (Microsoft's Unity and Ninject).

This Week in Spring, June 5th, 2012

Engineering | Josh Long | June 06, 2012 | ...

Welcome back to another installment of This Week in Spring. As usual, we've got a lot to look at this week so let's get to it..

  1. The video from Chris Beams's recent webinar on the various styles of dependency injection that Spring supports is up. Chris is a core Spring framework engineer (and all around good guy). This video is definitely worth a watch especially if you still think Spring configurations requires XML.
     <LI> Oleg Zhurakousky announced the availability of 
    	 <a href = "">
    	 Spring Integration 2.1.2 RELEASE and 2.2.0M2</A>. The new releases are filled with many important bug fixes as well as several  
    	 new features.  
    	<LI>  Roy Clarkson has announced the availability of <a href= "">Spring Android 1.0.0.RELEASE</A>! The project is an extension of the Spring Framework that aims to simplify the development of native Android applications by providing RESTTemplate support for…

This Week in Spring: May 29th 2012

Engineering | Adam Fitzgerald | May 29, 2012 | ...

Welcome back to another installment of This Week in Spring! As usual, we have a lot to cover, so let's get straight to it!

  1. Chris Beams has announced that the first milestone release towards Spring 3.2 is now available! This release is great!
    	It includes 
    	initial support for asynchronous <CODE> @Controller</CODE> methods,
    	early support for JCache-based cache providers,
    	significant performance improvements in autowiring of non-singleton beans,
    	initial delay support for <CODE> @Scheduled</CODE> and <CODE> &lt;task:scheduled&gt;</CODE>,
    	ability to choose between multiple executuors with <CODE>@Async</CODE>,
    	enhanced bean profile selection using the not (<CODE>!</CODE>) operator,  
    	48 bugs fixed, 8 new features and 36 improvements implemented. 

    Check out the latest and greatest bits now, and feel free to give feedback!

    When I asked for any items for consideration into this roundup on my Twitter account, one user immediately shot back: "With the Spring 3.2 news, how about a poll on whether the community wants 3.2 M1 to be followed by RC1. It's too good to wait." I agree, this release is

Spring Roo 1.2.2.RELEASE available

Engineering | Alan Stewart | May 28, 2012 | ...

The Spring Roo team is pleased to announce the availability 1.2.2.RELEASE.  This is the second maintenance release for 1.2 and includes fixes for a number of issues and includes support for Spring Framework 3.1.1 and JDK 7.  Roo 1.2.2 also includes the excellent new "tailor" feature provided by our new partner, Accenture.

I hope you enjoy this new release!


Spring Roo Project Lead

Transactions, Caching and AOP: understanding proxy usage in Spring

Engineering | Michael Isvy | May 23, 2012 | ...

In the Spring framework, many technical features rely on proxy usage. We are going to go in depth on this topic using three examples: Transactions, Caching and Java Configuration.

All the code samples shown in this blog entry are available on my github account.


First step: no transaction

The Service class below is not transactional yet. Let’s first look at it as is and then make it become transactional.

public class AccountServiceImpl  implements AccountService {

//Not specifying a transaction policy here!
 public void create(Account account) {

Since the method “create” is not transactional, it will most likely throw an exception (because this Account object should not…

This Week in Spring - May 22nd, 2012

Engineering | Josh Long | May 22, 2012 | ...

Welcome back to another installment of This Week in Spring. We have a lot of great content this week, as usual!

  1. Rossen Stoyanchev has put up another blog in his series on Spring MVC 3.2 Preview. This latest installment introduces a Spring MVC chat example.
  2. Oliver Gierke has announced the 1.1.0 GA version of Spring Data JPA. Spring Data JPA makes it very simple to build JPA-based repositories, saving you from the tedious boiler plate code. This new release includes new keywords for query generation (LessThanEqual, GreaterThanEqual, Before, After, StartsWith, EndsWith, and Contains), a handy PersistenceUnitPostProcessor to scan for JPA entities (to be used in Spring versions before 3.1), support for native queries in @Query, and support for declarative locking.
  3. Jonathan Brisbin announced the 1.0.0.M2 release of Spring Data REST. Spring Data REST let's you easily export your Spring repository objects as RESTful endpoints. The new release includes support for invoking query methods of Repository interfaces, support for JSR 303 and Spring Validator validations, and improved support for Spring ApplicationEvents that are emitted before and after each save or delete, and annotation-based configuration.
  4. Oleg Zhurakousky has announced the first milestone release of Spring Integration 2.2. This release includes dependency upgrades, JPA support, and support for "publisher confirms and returns," which are newly supported in Spring AMQP.
  5. Gary Russell has announced version 1.1.0 of Spring AMQP that includes support for the RabbitMQ 2.8.x client, which in turn supports mirrored queues, broker failover, publisher confirms, returns, federated exchanges, and much more.
  6. Matt Vickery has a great post introducing the Spring Integration splitter-aggregator pattern.
  7. Willie Wheeler has a great post up on his custom configuration management database (a CMDB). The post details the project, and then talks about his use of Spring Data's repositories in rebuilding the backend for CMDB. Nice post, Willie!
  8. Doug Haber put together a wonderful post on handling paging using Spring Data and the REST support in Spring 3.1.
  9. Blogger panbhatt has a detailed post on using Spring MVC's REST support to solve a particular set of problems he was having.
  10. Blogger OBSERWATORZY described his particular thought process when trying to consume a RESTful service, and wondering if Spring provided an answer (of course it did!). Read on for his resolution.
  11. Vishal Biyani has put together a nice introduction to getting started with Spring Roo and Cloud Foundry.
  12. The RabbitMQ blog has an amazing article introducing queueing theory (with an introduction to throughput, latency and bandwidth.
  13. JAXEnter has a nice roundup of some of the news releases described in this very post, including the Spring AMQP and Spring Data JPA's GAs.

Spring MVC 3.2 Preview: Chat Sample

Engineering | Rossen Stoyanchev | May 16, 2012 | ...

Last updated on November 5th, 2012 (Spring MVC 3.2 RC1)

In previous blog posts I introduced the Servlet 3 based async capability in Spring MVC 3.2 and used the spring-mvc-showcase and the Spring AMQP stocks sample to demonstrate it. This post presents a chat sample where the external events are not AMQP messages but rather HTTP POST requests with chat messages. In the second part of the post, I'll switch to a distributed chat where the events are Redis notifications.

Chat is not a common requirement for web applications. However it is a good example of a requirement that can only be met with real-time notifications. It is more sensitive to time delays than email or status alerts and it is not that uncommon to chat in a browser with a friend, or with a colleague during a webinar, or with a live person on a shopping site. You can imagine other types of online collaboration.

The Sample

The spring-mvc-chat sample is available on Github. Although not the focus of this blog post, the client side uses Thymeleaf, knockout.js, and jQuery. Thymeleaf is an excellent alternative to JSPs that enables clean HTML templates with support for previews allowing a designer to double-click an HTML template and view it unlike a JSP that requires a Servlet container. knockout.js is a client-side MVC framework that's very handy for attaching behavior to HTML elements. To get an idea about it quickly, follow one of its excellent tutorials. jQuery is used for DOM scripting and Ajax requests.


The ChatController exposes operations to get and post chat message. Here is the method to get messages:

public DeferredResult<List<String>> getMessages(@RequestParam int messageIndex) {

  final DeferredResult<List<String>> deferredResult = new DeferredResult<List<String>>(null, Collections.emptyList());
  this.chatRequests.put(deferredResult, messageIndex);

  deferredResult.onCompletion(new Runnable() {
    public void run() {

  List<String> messages = this.chatRepository.getMessages…

Get the Spring newsletter

Thank you!

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Spring Runtime offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all