Spring Framework 3.0 M2 released

Juergen Hoeller

We are pleased to announce that the second Spring 3.0 milestone is finally available (download page).
This release comes with a wealth of revisions and new features:

Further Java 5 style API updates: consistent use of generic Collections and Maps, consistent use of generified FactoryBeans, and also consistent resolution of bridge methods in the Spring AOP API. Generified ApplicationListeners automatically receive specific event types only. All callback interfaces such as TransactionCallback and HibernateCallback declare a generic result value now. Overall, the Spring core codebase is now freshly revised and optimized for Java 5.

Extended concurrency support: Spring's TaskExecutor abstraction has been updated for close integration with Java 5's java.util.concurrent facilities. We provide first-class support for Callables and Futures now, as well as ExecutorService adapters, ThreadFactory integration, etc. This has been aligned with JSR-236 (Concurrency Utilities for Java EE 6) as far as possible. Furthermore, we provide support for asynchronous method invocations through the use of the new @Async annotation (or EJB 3.1's @Asynchronous annotation). And in Spring 3.0 M3, we'll be adding a scheduling namespace for convenient configuration of it all… including support for cron-style timers.

OXM module in core: We moved the Object/XML Mapping module, as known from the Spring Web Services project, to the Spring core project. OXM has been updated and revised for Java 5 as well, supporting marshalling and unmarshalling through JAXB2, JiBX, Castor, XMLBeans, and XStream. There is also OXM support for Spring JMS (MarshallingMessageConverter) and Spring MVC (MarshallingView).

RestTemplate: We have brand-new client-side REST support: the long-awaited RestTemplate, with HTTP processing infrastructure that is as flexible and extensible as you would expect from a Spring solution. There are also several improvements with respect to REST support in Spring MVC… Stay tuned for Arjen's upcoming blog post on the latest REST support features!

MVC on Portlet 2.0: Spring Portlet MVC is based on the Portlet 2.0 API (JSR-286) now. We provide specific @ActionMapping, @RenderMapping, @ResourceMapping and @EventMapping annotations for Portlet MVC handler methods, including support for specific characteristics of those request types: e.g. action names, window states, resource ids, and event names (as defined by Portlet 2.0).

Early JPA 2.0 support: Finally, we are actively tracking the JPA 2.0 specification as well as emerging JPA providers with JPA 2.0 preview support. Spring 3.0 M2 already delivers early support for the JPA 2.0 API, e.g. query timeouts within Spring-managed transactions and QueryBuilder access in Spring-managed EntityManager proxies. We'll wrap this up for Spring 3.0 RC1, as soon as the JPA 2.0 API is stable.

Now is a good time to give Spring 3.0 an early try! Let us know how it works for you… M2 doesn't include reference documentation yet but comes with extensive javadoc and an extensive test suite. We'll also be showing specific examples in follow-up blog posts.

We are now working towards our final milestone already: M3 will introduce annotation-based factory methods, declarative validation (based on JSR-303 "Bean Validation"), as well as new XML configuration namespaces (orm, scheduling). Spring MVC will receive an overhaul in terms of conversation management. We are also preparing for JSF 2.0 as far as necessary, keeping up the smooth integration experience with Spring.

Similar Posts

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

46 responses


  1. Great job!!! Awesome product I've been waiting for this milestone to arrive. Here it is!!!

    Thanks again for a great product.


  2. It's great to see this milestone finally arrive, good job! You mention conversation management as a feature that will be included in 3.0 M3, will it be implemented as a custom scope such as Apache Orchestra's or will it be tightly coupled to Spring Web MVC?


  3. Great news !
    I'm looking forward to the new Spring MVC stuff.
    Any idea if you'll implement the @NamedController("foo") stuff we talked about after the Spring meeting in Paris last November ?


  4. Great News

    BTW, if all API is now Java 5 style, How will be the relationship between org.springframework.jdbc.core.simple and org.springframework.jdbc.core? Remember that org.springframework.jdbc.core.simple is already Java 5 style


  5. What will be 3.0's backwards compatibility level?


  6. Is there a JIRA on @NamedController("foo")? :-)


  7. My bad, ControllerBeanNameHandlerMapping does quite the same. But my idea was to push it even further, by working with pure logical names (not bean names). Hence my idea of @NamedControllers…


  8. Always good to see a new milestone!
    When will the reference documentation be available? Are there any articles that explain how to use the new Spring MVC REST support?
    Thanks.


  9. Gabriel,

    The reference documentation will be available as of 3.0 M3, although probably not fully up to date until 3.0 RC1.

    We'll start publishing blog posts on Spring 3.0's REST features within the next couple of days. We'll also publish a revised version of our PetClinic sample application as a showcase for the new REST support features.


  10. Tetsuo,

    Spring 3.0 aims to be 99% backwards compatible with Spring 2.5. The core APIs and SPIs will remain stable in order to keep existing extensions (and of course also existing application code) working. Introducing generics and varargs, as we've done in M1 and M2, should still preserve binary compatibility.

    That said, we generally recommend rebuilding your applications for Spring 3.0, in order to catch potential API issues early. This will also allow you to get the maximum benefit from Spring 3.0's Java 5 API refinements.


  11. Mario,

    JdbcTemplate is already full generified in 3.0 M2. SimpleJdbcTemplate will stay around with slightly different signatures, not providing the full power of JdbcTemplate but allowing for simple varargs more often than JdbcTemplate does.

    I would expect more people to stick with JdbcTemplate now. SimpleJdbcTemplate certainly loses some of its attractiveness now that the core JdbcTemplate and its callback interfaces are generified as well.


  12. Olivier,

    As Keith already hinted at: Please create a JIRA enhancement request for @NamedController. That'll also help me to remember what exactly we talked about back then in November :-)


  13. GB,

    Our plan with respect to conversation management is to introduce a core abstraction that we'll then build a custom BeanFactory Scope as well as a Spring MVC SessionAttributeStore adapter on top of. This will be smoothly integrated with Web Flow 3.0's conversation management as well.

    We also expect some Spring 3.x conversation support for JSF 2.0, but this has not been fleshed out yet. This won't be nearly as extensive as MyFaces Orchestra in terms of JSF support, though. Maybe a future Orchestra version will specifically integrate with Spring 3.0 for optimal interoperability.


  14. Thanks for the great work!

    Spring 2.5 included a repackaged ASM library, is 3.0 not going to do this? I have a dependency on ASM 3.1… am I out of luck?


  15. Spring 3.0 is going to refer to a repackaged spring-asm library eventually. We expect that change to happen for 3.0 M3 already. Due to the change in our build system, we simply didn't get around to it for M1/M2…


  16. I'm a bit confused as to the status of REST support in Spring MVC. Does M2 have this functionality, or is this for a later milestone?

    We have an upcoming project that requires REST, and it's either Spring 3 or the ghastly mess that is Restlets. It's all in the timing…


  17. Kenny,

    Yes, M2 already has 90% of the REST-oriented functionality that we're aiming for in Spring 3.0 (primarily for use with annotated Spring MVC handler methods): URI templates with @PathVariable extraction, @RequestHeader access, a ContentNegotiatingViewResolver, the client-side RestTemplate, etc.

    Arjen will be publishing a blog post on the details later this week.


  18. First of all,great job:-)I am thankful

    I migrated a project from Spring 2.5.6 to Spring 3.0.0M1 and now it isn´t possible to use the automatic controller detection ().In fact Tomcat couldn´t be started,cause the initialization failed.An Idea why?


  19. cron-styled timers in 3.0M3 – thank you ! You make my day. Working with the standard JDK API can be really annoying.


  20. Very much looking forward to the validation stuff. What is your plan for integration with a JSON view? Out in the open source community there are already a couple extensions

    spring-json http://spring-json.sourceforge.net/
    json-lib-ext-spring http://sourceforge.net/project/showfiles.php?group_id=171425&package_id=259636 (an outgrowth of a patch submitted for related to a JIRA.

    I posed the question of what direction your planning to go on the JIRA issue:

    http://jira.springframework.org/browse/SJS-1

    In the meantime, some are rolling there own and others are customizing one of those two solutions. It would be really nice to know which direction Spring 3 will take or if the issue will just be ignored.


  21. Juergen, can you give us a hint about configuring project dependencies for ASM and related libraries, to be able to switch from 2.5 to 3.0.M2?
    I want to give a try to Spring 3.0.M2 in my project, especially REST-related things. I've updated spring version and module IDs in my POM file to 3.0.0.M2, but during deployment to Tomcat it blows up at classpath scanning: first I got "ClassNotFoundException: org.objectweb.asm.commons.EmptyVisitor"
    then, after adding ASM dependency, I got: "java.lang.AbstractMethodError: org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.visit".
    I'm stuck completely. I've spent whole day trying to find out the necessary setup, but to no avail. From my perspective, Spring 3.0 M2 simply doesn't work at all… I guess many other people will have the same problem.
    You say "Now is a good time to give Spring 3.0 an early try!" – and we really want to do it, just give us a clue how to do it!
    I've reported a bug against it: http://jira.springframework.org/browse/SPR-5557


  22. Juergen, can you give us a hint about configuring project dependencies for ASM and related libraries, to be able to switch from 2.5 to 3.0.M2?
    I want to give a try to Spring 3.0.M2 in my project, especially REST-related things. I've updated spring version and module IDs in my POM file to 3.0.0.M2, but during deployment to Tomcat it blows up at classpath scanning: first I got "ClassNotFoundException: org.objectweb.asm.commons.EmptyVisitor"
    then, after adding ASM dependency, I got: "java.lang.AbstractMethodError: org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.visit".
    I'm stuck completely. I've spent whole day trying to find out the necessary setup, but to no avail. From my perspective, Spring 3.0 M2 simply doesn't work at all… I guess many other people will have the same problem.
    You say "Now is a good time to give Spring 3.0 an early try!" – and we really want to do it, just give us a clue how to do it!


  23. Sorry for the ASM confusion – this has been raised before and is a pain, admittedly. We will be switching to a repackaged spring-asm version in 3.0 M3, which will hopefully solve all those problems (similar to Spring 2.5). We simply haven't had time to figure this out within our new build system yet…

    The solution for the time being is to use standalone ASM 2.2.3 jars. You probably tried running against ASM 3.x instead…


  24. Well, I've actually tried to add standalone ASM 2.2.3 jars. I got "java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit" exception then. I tried ASM 2.2.3 jars from spring repositories. I got "java.lang.AbstractMethodError: org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.visit".
    I've tried countless combinations, with no lack (I've even reported it in SPR-5557 bug report in Spring JIRA). Unfortunatelly, I'm simply not able to switch from 2.5 to 3.0.M2. And I don't want to wait for M3 :)


  25. Are the artifacts published in some maven repository? I couldn't find them in neither the snapshot or the milestone reps.


  26. How does Spring 3.0 REST support compare to JAX-RS?

    I've read that Spring MVC 3.0 is different than JAX-RS, but Spring is a generic framework and I presume its relationship with REST would be somewhat different compared to Spring MVC.

    Thank you.


  27. @Tetsuo:
    Artifacts are available at Spring Milestones repository: http://repository.springsource.com/maven/bundles/milestone
    Remember about artifacts naming change in 3.0, e.g.:

    org.springframework
    org.springframework.context
    3.0.0.M2


  28. @Grzegorz – it is, but it is a pain actually. First there is no real browsing capabilities due to the underlying Amazon S3 Foo. Furthermore not all libraries seem to be located there. web.servlet can't be resolved, neither can test. Even the libd spring-library thing can be fully resolved.

    It's been not moch more comfortable with M1. I actually really want to take a glance at it but if setting up a sample project is so much effort… :( . Maybe there's someone out there to fix this?

    Greets,
    Ollie


  29. Sorry, but actually I wanted to say that spring-library libd file CANNOT fully resolve all contained artifacts.


  30. Seems the repo got stuck for a few minutes… Can resolve the artifacts now. Sorry for inconvenience.

    Ollie


  31. @Oliver: regarding browsing – do you know S3Browse http://s3browse.com/explore/repository.springsource.com/?


  32. Finally, I was able to run Spring 3M2. I had to change Hibernate dependencies from "plain" ones to OSGI versions from Spring repository, and fix the completely broken joda-time-hibernate library (that I happen to use) dependency declarations.
    See detailed description on bug report http://jira.springframework.org/browse/SPR-5557


  33. Finally, I was able to run Spring 3M2. I had to change Hibernate dependencies from "plain" ones to OSGI versions from Spring repository, and fix the completely broken joda-time-hibernate library (that I happen to use) dependency declarations.
    See detailed description on bug report SPR-5557 on Spring JIRA.

    BTW: the captcha system on this blog seems completely broken. I'm not able to post any comment containing link to spring jira, as I always had to pass captcha test, but actual captcha image is never displayed, and I'm always stuck. Please fix it.


  34. I've problems with downloading dependencies (using maven) from springsource repository . I added in my project dependency to spring-web (3.0 M2) and when I run "mvn jetty:run" most of dependencies are downloaded properly however these 3 below are missing.

    Here is error message:

    Missing:
    ———-
    1) org.aopalliance:com.springsource.org.aopalliance:jar:1.0.0

    Try downloading the file manually from the project website.

    Then, install it using the command:
    mvn install:install-file -DgroupId=org.aopalliance -DartifactId=com.springsource.org.aopalliance -Dversion=1.0.0 -Dpackaging=jar -Dfile=/path/to/file

    Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=org.aopalliance -DartifactId=com.springsource.org.aopalliance -Dversion=1.0.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId
    =[id]

    Path to dependency:
    1) xxx:xxx:1.0-SNAPSHOT
    2) org.springframework:org.springframework.web:jar:3.0.0.M2
    3) org.aopalliance:com.springsource.org.aopalliance:jar:1.0.0

    2) org.apache.commons:com.springsource.org.apache.commons.logging:jar:1.1.1

    Try downloading the file manually from the project website.

    Then, install it using the command:
    mvn install:install-file -DgroupId=org.apache.commons -DartifactId=com.springsource.org.apache.commons.logging -Dversion=1.1.1 -Dpackaging=jar -Dfile=/path/to/file

    Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=org.apache.commons -DartifactId=com.springsource.org.apache.commons.logging -Dversion=1.1.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
    -DrepositoryId=[id]

    Path to dependency:
    1) xxx:xxx:war:1.0-SNAPSHOT
    2) org.springframework:org.springframework.web:jar:3.0.0.M2
    3) org.apache.commons:com.springsource.org.apache.commons.logging:jar:1.1.1

    3) org.antlr:com.springsource.org.antlr:jar:3.0.1

    Try downloading the file manually from the project website.

    Then, install it using the command:
    mvn install:install-file -DgroupId=org.antlr -DartifactId=com.springsource.org.antlr -Dversion=3.0.1 -Dpackaging=jar -Dfile=/path/to/file

    Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=org.antlr -DartifactId=com.springsource.org.antlr -Dversion=3.0.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

    and here is part of my pom.xml with repository and dependencies declaration:

    sringsource
    http://repository.springsource.com/maven/bundles/milestone

    org.springframework
    org.springframework.web
    3.0.0.M2

    junit
    junit
    3.8.1
    test

    freemarker
    freemarker
    2.3.8

    org.apache.tiles
    tiles-core
    2.0.7

    am I doing something wrong or is repository broken?


  35. Do anyone see the PetClinic sample in the package? I can't find it although the README.txt says "Check out the provided PetClinic sample application. It has been fully updated for
    Spring 3.0 already."


  36. Hi Juergen,

    What is the situation of the Tiles support in the 3 version? While I am upgrading old version Spring applications to the 3 version, I find the new Spring is not compatible with the previous version in regarding of the Tiles 2 support. In fact, an old code is broken in the new Spring version. And I can't find any related documentation.


  37. I have searched a while now, but i was not able to find a release schedule. Does anyone know when spring 3 will be released?


  38. I'm curious: How is/should the Exception translation in Spring 3.0 be done? In particular, the JPA implementation of the Clinic (EntityManagerClinic) declares to throw DataAccessExceptions but I have not found any code that translate the e.g. JPA's NoResultException into Springs EmptyResultDataAccessException, nor does the EntityManagerClinic extend any JpaDaoSupport or something like this. Is this done transparently? For which exception should I check in my service methods? Have I missed something?

    Thanks in advance.

    Dominik


  39. I'm curious: How should the Exception translation in Spring 3.0 be done? In particular, the JPA implementation of the Clinic (EntityManagerClinic) declares to throw DataAccessExceptions but I have not found any code that translate the e.g. JPA's NoResultException into Springs EmptyResultDataAccessException. Is this done transparently? For which exception should I check in my service methods? Have I missed some aspect or something?

    Thanks in advance.

    Dominik


  40. Hi, Juergen

    would u like to talk more about "and also consistent resolution of bridge methods in the Spring AOP API."?
    I want to know more details on this, but can't find any useful information,hehe


  41. Replying to Michal, I found if I added the following maven repo in addition to the SpringSource milestone repo I was able to download all artifacts required

    atlassian-m2-repository
    https://m2proxy.atlassian.com/repository/public

    There may be a better URL for the missing artifacts, but this one works so I'm using it until someone suggests something better.


  42. In Class: SpelAntlrExpressionParser, it has imported some codes from another open source project:

    import org.antlr.runtime.ANTLRStringStream;
    import org.antlr.runtime.CommonTokenStream;
    import org.antlr.runtime.RecognitionException;

    Will this dependency be removed before 3.0 GA?

    Ming


  43. Could you please give us an update about the next releases of Spring 3.0? I am currently experimenting the REST capabilities. I find it very difficult to find any pointers to good documentation / examples for it. I found a link to some documentation (http://www.epril.com/resources/spring3/reference/html/ch18s02.html) but it seems that the @RequestBody annotation is not yet supported in the M2 release.
    I am trying to convinced my project manager to use this new version of the framework to ease developments but he is asking about stable release of it.
    I am also having some performance issues when running my application under jonas 4.8 version. Maybe because I use jaxb to marshall my requests body but not sure… Any help would be very much appreciated.
    I also read somewhere that Arjen Poutsma was to write an article about the HttpMessageConverter that would allow to 'automatically' transform http requests body into jaxb beans but I cannot find it.

    Karine


  44. Hello.

    I used springframework 3.0.0.M2 in creating an Authorization Filter on a company intranet site. Another office would like to re-use the solution, however, they are running Java 1.4.

    I suggested that the other office upgrade to Java 5 (and keep up at least one step behind, not two!) but no dice: they mean to keep Java 1.4!

    My own solution was relatively simple, and made use of these classes:
    import org.springframework.context.ApplicationContext;
    import org.springframework.web.context.support.WebApplicationContextUtils;

    Any chance my solution will run on Java 1.4?


  45. Hi, Juergen

    Can't wait to have the conversation management feature in Spring MVC. I have used Seam before and know how convenient to have it for web layer. Can you provide a time frame of the 3.1 release?

    Thanks.


  46. The first Spring 3.1 milestone is scheduled for release towards the end of March, including the basic conversation management feature set already. A release candidate is expected to be available in June.

    Juergen

8 trackbacks

Leave a Reply