Blogs

SpringSource Blog

Spring Framework 3.0 goes GA

Juergen Hoeller

After a long ride, it is my pleasure to announce that Spring 3.0 GA (.RELEASE) is finally available (download page)! All of SpringSource is celebrating – join the party :-)

For some very recent news, Spring 3.0 GA is compatible with Java EE 6 final in terms of runtime environments now (e.g. on GlassFish v3 as released last week) and supports JPA 2.0 final already (e.g. using EclipseLink 2.0). We also support the newly introduced @ManagedBean (JSR-250 v1.1) annotation for component scanning now, which nicely complements our @Inject (JSR-330) support for annotation-driven dependency injection.

For your convenience, here is a summary of key features in Spring 3.0 overall:

* Spring expression language (SpEL): a core expression parser for use in bean definitions, allowing for references to nested bean structures (e.g. properties of other beans) as well as to environmental data structures (e.g. system property values) through a common #{…} syntax in property values.

* Extended support for annotation-based components: now with the notion of configuration classes and annotated factory methods (as known from Spring JavaConfig). Spring also allows for injecting configuration values through @Value expressions now, referring to configuration settings via dynamic #{…} expressions or static ${…} placeholders.

* Powerful stereotype model: allows for creating 'shortcut' annotations through the use of meta-annotations, e.g. for default scopes and default transactional characteristics on custom stereotypes. Imagine a custom @MyService annotation indicating @Service, @Scope("request") and @Transactional(readOnly=true) through a single annotation.

* Standardized dependency injection annotations: Spring 3.0 comes with full support for the JSR-330 specification for Dependency Injection in Java – annotation-driven injection via @Inject and its associated qualifier and provider model, as an alternative to Spring's own @Autowired and co.

* Declarative model validation based on constraint annotations: Spring-style setup of a JSR-303 Bean Validation provider (such as Hibernate Validator 4.0). Comes with an annotation-driven validation option in Spring MVC, exposing a unified view on constraint violations through Spring’s binding result facility.

* Enhanced binding and annotation-driven formatting: Converter and Formatter SPIs as an alternative to standard PropertyEditors. Formatting may be driven by annotations in a style similar to JSR-303 constraints, e.g. using @DateTimeFormat. Also, check out the new mvc namespace for convenient setup of formatting and validation in Spring MVC.

* Comprehensive REST support: native REST capabilities in Spring MVC, such as REST-style request mappings, URI variable extraction through @PathVariable parameters, and view resolution driven by content negotiation. Client-side REST support is available in the form of a RestTemplate class.

* Rich native Portlet 2.0 support: Spring MVC fully supports Portlet 2.0 environments and Portlet 2.0’s new event and resource request model. Includes specialized mapping facilities for typical portlet request characteristics: @ActionMapping, @RenderMapping, @ResourceMapping, @EventMapping.

* Object/XML Mapping (OXM): as known from Spring Web Services, now in Spring Framework core. Marshalling and Unmarshaller abstractions with out-of-the-box support for JAXB 2, Castor, etc. Comes with integration options for XML payloads in Spring MVC and Spring JMS.

* Next-generation scheduling capabilities: new TaskScheduler and Trigger mechanisms with first-class cron support. Spring 3.0 comes with a convenient task namespace and also supports @Async and @Scheduled annotations now. This can be executed on top of native thread pools or server-managed thread pools.

Beyond those big themes, there are hundreds of refinements in the details which you will particularly appreciate when upgrading from Spring 2.5. Check the changelog and the javadocs…

In terms of system requirements, Spring 3.0 covers a broad range of environments. For two key characteristics, Spring 3.0 supports Java SE 5 and above and Servlet 2.4 and above, e.g. Tomcat 5.x and 6.x, also retaining compatibility with common enterprise servers such as WebSphere 6.1 and WebLogic 9.2 (which are formally still based on J2EE 1.4). At the same time, we support GlassFish v3 already – adapting to Java EE 6 API level in Spring as well.

As a consequence, Spring 3 brings brand-new component model features, and also standards like JSR-330 injection and JSR-303 validation, to established production environments – without having to upgrade your server installation! All you have to do is to upgrade the application libraries of your Spring-powered application to Spring 3.0…

Enjoy – and watch out for follow-up posts about specific Spring 3 features, as well as for samples running on Spring 3.0!

Similar Posts

Share this Post
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Slashdot
  • Technorati
  • Twitter
 

40 responses


  1. Hi

    Is it available in your Maven Repository and if so, what is the exact version id?
    spring-core.3.0.0.jar is not found for instance (but spring-core.3.0.0.RC3.jar is)

    Thanks

    Benoit


  2. Hi,

    Do you know when will be available the new tutorial of "Developing a Spring MVC application step-by-step" ??

    Regards,

    JL Monteagudo


  3. Great work guys. It's been a long time coming, but now I can stop feeling guilty about using RC-quality libraries in my production apps :)


  4. When will it be available at maven central repo


  5. Will you be releasing a download that includes dependencies?


  6. Any maven repo holding these artifacts yet?


  7. Spring Maven/Ivy Users,

    When we cut a release, we automatically publish Spring artifacts to our Maven Central-compatible sync repository as well as our Enterprise Bundle Repository (EBR). It takes up to 6 hours for Maven Central itself to pickup the new artifacts after they are published to the sync repo.

    See the following links for information on how to obtain Spring using Maven / Ivy:
    1. http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven
    2. http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/overview.html#dependency-management

    Enjoy Spring 3.0!

    Keith


  8. Definitely second the motion for a build with dependencies. Thanks. Great work!


  9. According to the Spring 3 Reference Documentation :

    "There is now a new getting started tutorial for developing a basic Spring 3.0 MVC web application. This tutorial is a separate document that can be found at the Spring Documentation page".

    Does anyone know where this tutorial can be found ?


  10. A fresh Spring 3 step-by-step tutorial will be available shortly, along with several reference applications illustrating the new capabilities. Watch this space!

    Keith


  11. Sigh. I had to download aopalliance.jar separately from sourceforge, as it is no longer bundled with the new Spring 3.

    (I dont use Maven/Ivy painfulware).


  12. The version for maven is '3.0.0.RELEASE', just in case anyone was searching like I did.


  13. 1 for a build inclusing dependencies. For non maven/ivy users it's very painful to download dependencies.


  14. Congrats.
    Will be waiting for updated tutorial.


  15. For those of you seeking a with-dependencies.zip Download for Spring 3, I've opened a JIRA to track this improvement: http://jira.springframework.org/browse/SPR-6575.

    Please do vote on the JIRA if you need this; even better, add a comment explaining why you need it and why the basic .zip is not sufficient for you.

    Keith


  16. Upgraded my existing project from 2.5.6 to 3.0.0 with only less than 10 lines of code fixes (due to Spring's API being generics now). Built and tests passed.

    Will be exploring more on the @Configuration, SpEL and OXM side. Thanks a lot!


  17. Hi Guys,

    What the "GA" means?

    Thanks


  18. GA = Generally Available


  19. Congrats guys!

    Should this be 'drop in compatible' with 2.x?

    Erwin


  20. Hi Juergen,

    Thanks to all the great team work for Spring Source architects and developers for developing a great product. I wrote a article in early summer parsing Spring MVC 3.0 and how much i appreciate it but i have one problem with the MVC model. Could you please read my blog to address that issue with the help of model injection with the help of qualifiers in the handlers, so that the model are not tied to one implementation. Link to my blog is available at http://p3knowsmvc.blogspot.com/2009/06/spring-mvc-close-to-perfect.html.

    Regards


  21. Erwin, Spring 3.0 is basically 99.9% backwards compatible with Spring 2.5. For most applications, it should be a drop-in replacement since we preserved binary compatibility as far as possible. When recompiling your application code, you might have to adapt the use of generics here and there (in particular to get rid of warnings but in very few cases also to make it compile). That should be about it.

    Juergen


  22. Uhm, no updated petclinic sample within the download or on the SVN, no documented upgrade path from the deprecated AbstractFormController classes and the portlet documentation not reflecting the new code supporting JSR286… was this release a little bit rushed? c'mon guys I'm really happy for the christmas gift but I expected more!


  23. Hi Mago,

    The updated Petclinic sample is available here: https://src.springframework.org/svn/spring-samples/petclinic.

    Also, on Monday, we will begin blog series called "Spring 3 Simplifications" that will highlight new 3 features and provide runnable examples showing how to apply them. I think Spring users will get a lot out of this, and you can expect this kind of stuff to continue into 2010.

    There is also a upgrade guide that will publish soon that will include a path from the FormController hierarchy to the @Controller programming model.

    I've also opened a JIRA about the documentation gap in JSR-286 samples. I encourage those already using Spring's Portlet 2.0 support in practice to contribute to expanding our coverage in this area.

    Keith


  24. Cannot compile petclinic :

    [checking org.springframework.samples.petclinic.jpa.EntityManagerClinic]
    /home/ceefour/Vendor_Dev/petclinic/src/main/java/org/springframework/samples/petclinic/jpa/EntityManagerClinic.java:52: cannot find symbol
    symbol : class Query
    location: class org.springframework.samples.petclinic.jpa.EntityManagerClinic
    Query query = this.em.createQuery("SELECT owner FROM Owner owner WHERE owner.lastName LIKE :lastName");


  25. Hendy,
    There was a minor issue with the recently optimized Petclinic .pom – I have corrected this and Petclinic should compile and deploy without issue now. If there are any further issues you discover with the samples, please report them at http://jira.springframework.org/secure/BrowseProjects.jspa#10120.

    Thanks!

    Keith


  26. Hi,

    In our current application we are using spring 2.0.4. I have replaced the spring 2.0.4 jars with spring 3.0 jars. After resolving couple of issues our application is working fine. But i want to know about the known issues which i could face or other developers are facing during migration from 2.0.x to 3.0.

    Best Regards
    Muhammad Uzair Baig
    Software Development Module Lead
    Dubai Customs


  27. 1 for a release with dependencies. SpringSource doesn't seem to be in any kind of alliance with Maven, why would it force everyone to use it, then?

    BTW, Spring 2.5.6 worked fine without an aopaliance JAR, yet 3.0 fails with an exception without that JAR, with all the same code and configs. Seems like a forced dependency to me…


  28. Hi @Karem. Thanks for the maven version number. This should have been in the original post IMHO.

    Regs, Andrew


  29. Exciting news Jeurgen. Thanks for the great work !!! Looking forward to seeing if we have any problems upgrading from 2.5. :)


  30. Can someone translate the following to 3.0 language;

    Then, from the Spring distribution, copy spring.jar (from spring-framework-2.5/dist) and spring-webmvc.jar (from spring-framework-2.5/dist/modules) to the new 'war/WEB-INF/lib' directory. Also, copy commons-logging.jar (from spring-framework-2.5/lib/jakarta-commons) to the 'war/WEB-INF/lib' directory.


  31. Still no package available with dependencies included. Huge pain to hunt down the newest libs for Spring. Please provide a download option that includes dependencies as stated on your download page.


  32. Hi, everyone

    I encounter a problem during defining bean definitions in XML using spring 3.0, there are many "" config's literal value occurs "#", i.e.

    My intention is to get property url's value, and then replace "#{name}" and "#{age}" dynamically in programmes. So the placeholder is "#". "&" represents "&" in xml. These codes works fine in spring 2.0. Spring 3.0 recoginzes "#" as SpEl, so it can't work, many exceptions have been thrown when loading XML. I don't want to alter any codes including using proerties files to store these values, and use BeanFactoryPostProcessor's implemntation PropertyPlaceholderConfigurer.

    Is there any parameter that can tell spring 3.0 to ignore "#", that's to say, dont't make spirng 3.0 use expression language?


  33. Looks great!

    Looking forward to the step-by-step tutorial.


  34. The spring MVC sample application can be found here : http://www.springsource.org/webflow-samples


  35. Hi everyone,

    I've read that Spring 3.0 is backwards compatible with Spring 2.5. But, I think when you're referring that, is just meaning about code developed under 2.5 and being compiled at 3.0.

    But I have a very specific situation. I need to integrate a system being developed using Spring 3.0, and I need to call some services developed under Spring 2.5, running inside another web app, using Spring Remoting.

    Is that possible? Would I fall into serialization issues?

    Thanks!


  36. Any schedule for publishing MVC 3 step by step tutorial?


  37. Thanks. good post


  38. Is the tutorial available now?


  39. When is the tutorial coming out?


  40. What about now? :P

35 trackbacks

Leave a Reply