Newest Post

This Week In Spring - April 30th, 2013

Read more

Introducing Spring XD

Today we are officially kicking off a new initiative called Spring XD whose theme is “tackling Big Data complexity”1.

The Spring Data team has been incredibly busy over the past few years, not only providing support for NoSQL datastores but also simplifying the development experience with Hadoop. With the creation of the Spring for Apache Hadoop project, we made it easier to get started developing Hadoop applications by providing a rich configuration model and a consistent programming model across Hadoop ecosystem projects such as Hive and Pig. As Spring users would expect, one can:

Read more

This Week in Spring - April 23rd, 2013

Welcome back to another installment of This Week in Spring! Here in San Francisco, we're experiencing the first fits of life and beautiful weather typical of spring time. Fitting, too, as things are busy-as-can-be in the Pivotal open source communities - including Cloud Foundry and SpringSource - as we march towards the Pivotal Initiative launch on April 24th. See you then!

Without further ado, let's get into this week's roundup:

  1. Have you guys seen the amazing Java configuration support in Spring Batch 2.2.0.RC1? The code I've just linked you to demonstrates a complete working Spring Batch job that reads in a .csv file and then writes the records to a data source, all of which are configured in the class, entirely in Java. This demonstrates the @EnableBatchProcessing annotation in 2.2.0. Check it out!
  2. New SpringOne2GX replays now available in HD on YouTube: Implementing Domain Driven Design with Spring and vFabric, Batch Processing and Integration on Cloud Foundry and a bonus session, Understanding Java Garbage Collection and what you can do about it.
  3. The FuzzyDB open source project tweeted that they'd released a new version of FuzzyDB with Spring Data bindings aligned with the Spring Data Arora release train. Congratulations, guys!
  4. Have you had a chance to play with Thymeleaf, the HTML5 and Spring MVC-friendly templating engine? If you'd like to learn even more, you'll probably like this presentation called Thymeleaf, Will it Blend?
  5. David Welch put together a quick demo of Spring Data Mongo and made the work available. He tweets that he went from working demo in 8 minutes with 4 classes and a pom.xml. Nice work man!
  6. Check out Ramnivas Laddad's awesome talk CloudFoundry Architecture talk at SpringOne2GX up live on the SpringSource YouTube channel SpringSourceDev.
  7. Spring HATEOAS lead Oliver Gierke tweeted a link to this post, "How I Explained REST to my wife", which would seem at first to be just one person's attempt at explaining a fairly deep technology concept to a person who didn't have the same technical background, but quickly turns into a (I think really insightful) look at the applicability of REST. Check out Spring HATEOAS if you want to take your REST-fu to the next level.
  8. I'm personally enamored of the new Java configuration APIs, both those recently released and those currently available in preview releases. I showed a very simple example of the Spring Batch API above. I also took a moment last week to write about the powerful Spring Social Java configuration API soon to be available in the 1.1.0.M2 release.
  9. You can have Spring perform a sort of pre-condition check by using the @Required annotation to insist at runtime that a property be satisfied with a non-null value, or Spring will abort the construction of the object. This helps avoid any silent NullPointerExceptions. This JavaBeat post does a nice job explaining how to use @Required.
  10. The how to do in java blog has a nice posting on how to create a custom UserDetailsService in Spring Security 3.
  11. The JavaCodeGeeks blog has a nice post on how to create RESTful services with Spring MVC.
  12. Brian's Java Blog has a nice post on using Spring AOP with both annotation and XML-centric configuration options.
Read more

Spring Tool Suite and Groovy/Grails Tool Suite 3.3.0.M1 released

Dear Spring Community,

I am happy to announce the first milestone release 3.3.0.M1 of the Spring Tool Suite (STS) and the Groovy/Grails Tool Suite (GGTS).

Highlights from this milestone build include:

  • Spring IDE: improved support for JavaConfig-driven Spring projects
  • Groovy-Eclipse: now supports customizable editor templates
  • Groovy-Eclipse: navigation and hovers in binary (compiled) groovy files
  • Grails-IDE: preliminary support for current builds of Grails 2.3

Both tool suites ship on top of the latest Eclipse Juno SR2 release. For optimal performance and stability we still recommend the distribution that is
based on Eclipse 3.8.2.

Read more

This Week in Spring - April 16th, 2013

Welcome to another installment of This Week in Spring!
It’s been an exciting week for Spring at Pivotal, which you can hear more about at the re-scheduled Pivotal launch event on April 24th.

  1. In case you are reading too fast, Pivotal has re-scheduled the launch event to April 24th. Register here!

  2. Arjen Poutsma has
    announced Spring Web Services 2.1.3.RELEASE
    . The new release mainly consists of bug fixes, for the full details check out the changelog.
  3. Don’t miss the upcoming Webinar with Donald Miner and Mark Pollack discussing Pivotal HD and Spring Hadoop, a good introductory webinar for those that are Pivotal HD-curious.

  4. New SpringOne2GX replays now available in HD on YouTube: Cloud Foundry Architecture, Effective Design Patterns in NewSQL

  5. There was a great post on Reddit the other day that explains the difference between

    REST and SOAP in terms of Martin Lawrence
    . This has nothing to do with Spring, but was droll enough that it’s worth sharing.

      Spring, of course, has an amazing REST stack and I highly encourage people to check out how to build consolidated, streamlined REST services with Spring! Moving on... :) 

  6. James Rossiter has a good post on how to use a Spring InitBinder to Resolve Type Mismatch and bind Exceptions in POST from Spring MVC to Controller Actions.
  7. @olivergierke brings up a great point on Twitter: how much code does it take to add the JTA 1.2 JSR javax.transaction.Transactional annotation to Spring? Almost nothing! Most of the code here is just unit tests. Otherwise, this is just a dead simple mapping of the JTA annotation to Spring’s already supported engine, which also currently supports the native Spring @Transactional and @javax.ejb.TransactionAttribute annotation.

  8. Are you looking into Gradle and want to get started with Spring, quickly? Giancarlo Frison has put together a nice post with a bootstrap Gradle build that can be used with Spring applications.

  9. Eugen Paraschiv has put together a nice post on how to use RestTemplate to do HTTP BASIC authentication.

  10. Spring has long supported a utility class, called the org.springframework.util.StopWatch, which can be used to measure the execution of method invocations.
    The Javarevisited blog has a

      <a href="">nice post on how to use the <CODE>StopWatch</code> class</a>.

  11. This post is fairly old, but I just stumbled upon it and thought it was a well thought out

    presentation introducing Aspect Oriented Programming (AOP) in Spring
Read more

This Week in Spring - April 9th, 2013

Welcome to another installment of This Week in Spring! As usual, we’ve got a lot to cover, so let’s get to it!

         <A href="">SpringSource CTO Adrian Colyer</a>  outlines the direction and momentum  of SpringSource and the Spring projects under the 
            <A href="">Pivotal Initiative</a>, a new company spun out of EMC comprised of - among other things - SpringSource, Cloud Foundry, and GreenPlum. 
        This is <EM>definitely</EM> worth a read if you want to understand Spring's - <EM>ahem</EM> - <EM>Pivotal</EM> role in this new initiative! 
    <LI> Spring Batch lead Michael Minella has <A href=""> announced that Spring Batch 2.2.0.RC1 is now available</a>.
        The new release includes preliminary support for Spring Data, Java configuration support, non-identifying job parameters 
        and numerous fixes and polishes. This release is amazing, and definitely worth a look. I, personally, <EM>love</EM> the Java configuration API that's
        been surfaced. You don't need to write another Spring Batch XML file if you don't want to!

    Spring Mobile lead Roy Clarkson has announced that
    Spring Mobile 1.1.0.M3 has been released featuring
    simpler configuration when using a custom domain strategy with SiteSwitcherHandlerInterceptor, support for Kindle Fire device detection (as tablet or mobile depending on which mode they are in), several resolved issues and compatibility with Spring Framework 3.2.2.

        <LI>New SpringOne2GX replays now available in HD on YouTube: <a href="">Virtualizing and Tuning Large Scale Java Applications, From Spring and Java to Spring and Akka</a></LI>
        <LI>The HMK blog has a <EM>really</EM> nice post on how to use the <A href= "">Cujo.js</A>'s
    <A href="">
     <CODE>rest.js</CODE> and Spring MVC</a>. <EM>Very</EM> cool! 
        The  <EM>JavaRevisited</EM> blog has  put together a 
        <a href="">post on calling stored procedures from Spring</code> using the <CODE>StoredProcedure</CODE> template object. 
        There are other ways to approach this same problem, including the <CODE>SimpleJdbcCall</CODE> object and simply using the 
        <CODE>update(String, Object ... params) </CODE> method on <CODE>JdbcTemplate</CODE>. Check it out! 

  1. The Spring Java Tutorial blog has a nice post on using
    stored procedures with Spring
    , and it also uses the same domain example - an EmployeeDAO.
    They aren’t exacty the same - far from it - but it does seem like one heckuva coincadence! At any rate, more information’s always good.

        Spring provides various lifecycle callback methods, <A href="">which this <EM>JavaBeat</EM> blog looks at</a>.   </LI>
        The <EM>Binary Beans</EM> blog has a post that <A href=""> simply links to some interesting, introductory videos</a> that we've published on
         <A href="">the SpringSourceDev YouTube Channel</A>.  If you're a regular reader of this round up then you've seen these videos before.
         But, it's a good 3 hours of introductory content and worth a look if you want a good getting started experience.
        KH Yiu has put together a cool post <A href=""> introducing the concept of a factory pattern</a> (which you're no doubt already familiar with!) 
        in application code, built with Spring. This is <EM>not</EM> about how Spring uses the factory pattern, and was kind of an interesting approach.
        Nicely done!
    <LI> Daniel Wong put together a really cool blog illustrating how to <A href="">tie together Spring MVC with OpenCMS</a>! Definitely worth a look. </LI>
        The <EM> 11th Hour</EM> blog put together a nice post on <a href="">how to use the Spring Expression Language with some examples</a>.
        Wang Xiang's  put together a blog.. more like a series of snippets..  demonstrating how <A href="">to setup Jetty, a  <CODE>DataSource</CODE>, and Spring together</a>. 
        The <EM>Java Code Geeks</EM> blog has an introductory post <A href="">on using Spring MVC with JSR 303 bean validation</A>. Check it out!

  2. Our pal Mark Serrano is back, this time with a review of Spring Security lead Rob Winch’s book on Spring Security.

  3. Hippoom Zhou has put together a nice post introducing how to use

    mocks and stubs in Spring Integration tests
    . This is a very nice post, and definitely worth a look!
  4. <LI>
        The awesomely named <EM>Raging Goblin</EM> blog has a nice post on how to do <A href="">role-based views using Spring Roo and Spring Security</a>. 
        Peter Chng describes a scheme that can be used to <A href=""> auto-register custom converters used for data type conversion</A> in core Spring, Spring MVC, and Spring Integration, among other places. Pretty smart! 

Read more

SpringOne 2GX 2012 Replays: Virtualizing and Tuning Large Scale Java Applications, From Spring and Java to Spring and Akka

Virtualizing and Tuning Large Scale Java Applications

This session shares many of the production proven methods of running Java on vSphere. Covering how to size JVMs, and VMs for large scale deployments. The session will have a special section on GC tuning and show how a wide range of JVMs can be tuned using a GC recipe developed over the past 15 years of actual field experience in tuning JVMs.

Three key trends and associated tuning techniques are discussed in this session. The key trends are: Consolidation, Elasticity and Flexibility, and Performance

Consolidation Many of our customers find that their middleware deployments have proliferated and are becoming an administrative challenge associated with higher costs. We see a trend across customers who look to virtualization as a way of reducing the number of server instances. At the same time, customers are taking the consolidation opportunity to rationalize the number of middleware components needed to service a particular load. Middleware components most commonly run within a Java Virtual Machine (JVM) with an observed scale of 100 to 1000s of JVM instances and provide many opportunities for JVM instance consolidation. Hence, middleware virtualization provides an opportunity to consolidate twice – once to consolidate server instances, and, secondly, to consolidate JVM instances. This trend is far-reaching, because every IT shop on the planet is considering the cost savings of consolidation. One customer in the hospitality sector went through the process of consolidating their server footprint and at the same time consolidated many smaller JVMs that were less than 1GB heap. They consolidated many of these smaller 1GB JVMs into 2 categories, those that were 4GB, and others that were 6GB. They performed the consolidation in such manner that the net total amount of RAM available to the application was equal to the original amount of RAM, but with fewer JVM instances. They did all of this while improving performance and maintaining good SLAs. They also reduced the cost of administration considerably due to the reduced number of JVM instances they had to manage, and refined environment that helped easily achieve SLA.

Another customer, in the insurance industry, was able to achieve the same as the above customer, but additionally was able to over-commit CPU in development and QA environments in order to save on third party software license costs. On the other hand, sometimes we come across customers that have a legitimate business requirement to maintain one JVM for an application, and/or one JVM per a line of business. In these cases, you cannot really consolidate the JVM instances, as that would cause intermixing of the lifecycle of one application from one line of business with another. However, while such customers don’t benefit from eliminating additional JVM instances through JVM consolidation, they do benefit from more fully utilizing the available compute resource on the server hardware, that otherwise would have been underutilized in a non virtualized environment

Elasticity and Flexibility It is increasingly common to find applications with seasonal demands. For example, many of our customers run various marketing campaigns that drive seasonal traffic towards their application. With VMware, you can handle this kind of traffic burst, by automatically provisioning new virtual machines and middleware components when needed, and then automatically tear down these VMs when the load subsides. In addition, the ability to change updating/patching hardware without causing outage is paramount for middleware that supports the cloud era scale and uptime. VMware VMotion gives you the ability to move VMs around without needing to stop applicators and or the VM. This flexibility alone makes virtualization of middleware worthwhile when managing large-scale middleware deployments. One customer in the financial space, handling millions of transactions per day, used VMotion quite often to schedule their hardware upgrades without any time downtime. What otherwise would be a costly scheduled downtime to their business.

Performance Customers often report improved middleware platform performance when virtualizing. Performance improvements are partly due to the updated hardware that customers will typically refresh during a virtualization project. There is also some performance improvement due to the robust VMware hypervisor. A recent customer that reported a great level of performance provided the following testimony

“With our OrderExpress project we upgraded our Middleware Services, Commerce, Portal, WCM, Service Layer, DB2 Database; migrated from AIX to Linux; virtualized on VMware; moved the application into a three-tier DMZ; increased our transactions by over 150 percent; and added significant new capabilities that greatly improved the customer experience. Changing such a wide range of technology components at once was a huge challenge. However using VMware vSphere and additional architectural changes we were successful in improving performance by over 300 percent; lowered costs in the millions; improved security, availability, and scalability; and how we plan to continue evolving this application to maintain greater than 30 percent yearly growth.”

– Jeff Battisti, Senior Enterprise Architect at Cardinal Health

In this session, I will show some actual JVM and VM sizes for middleware components both small and large JVMs. Will also detail out GC tuning recipe that I have developed over the years,that has been shown to handle JVM heap sizes form 4GB to 88GB+, and higher. Of course the introduction of in-memory databases has driven the trend to have these larger JVMs and hence why we will discuss what is the best way to tune the JVM, VM, and the hardware platform they are deployed on.

I see the sizing question as the most commonly asked question with our customer base,and as a result I plan to focus on it during the session.

Read more

Spring Batch 2.2.0 RC1 is now available

We are pleased to announce that Spring Batch 2.2.0.RC1 is now available via the SpringSource Milestone repository.
Spring Batch Home | Source on GitHub | Reference Documentation

Support for Spring Data

Spring Data Repository ItemReader ItemWriter RepositoryItemReader RepositoryItemWriter Repository

Java Configuration

@EnableBatchProcessing @EnableBatchProcessing

  • Creation of StepScope - Allowing the configuration of beans via @Scope(“step”)

  • @Autowired - A JobRepository, JobLauncher, JobRegistry, PlatformTransactionManager, JobBuilderFactory and StepBuilderFactory are all available to be autowired into your context.
Read more

Spring Mobile 1.1.0.M3 Released

Dear Spring Community,

We are happy to announce the release of Spring Mobile 1.1.0.M3!

Spring Mobile provides extensions to Spring MVC that aid in the development of cross-platform mobile web applications.

This release adds simpler configuration when using a custom domain strategy with SiteSwitcherHandlerInterceptor. Kindle Fire devices are now detected as tablet or mobile depending on which mode they are in. Additionally, several issues have been resolved in this release. This release is built and tested against Spring Framework 3.2.2. See the changelog and reference manual for more information. Many thanks to the community for their continued feedback and support in improving Spring Mobile.

Read more

Spring and Open Source at the Pivotal Initiative

By now you’ve probably heard about Pivotal. I’d like to take a moment here to explain what this means for Spring, and to tell you about some of our plans for 2013.

In case you missed it, here’s the essential background on Pivotal: Led by Paul Maritz, the initiative unites key people and projects from across EMC and VMware to bring “consumer grade” technology to the enterprise. We see a new generation of applications emerging that are powered by new data fabrics and will interact with and serve customers in the context of who they are, where they are, and what they are doing in the moment. These applications will be built, deployed, and scaled at unprecedented pace. They will store, manage, and deliver value from large data sets, and do all of this on one unified platform underpinned by open source technologies.

Read more