Migrating to Spring Framework 3.2In this appendix we discuss what users will want to know when upgrading to
Spring Framework 3.2. For a general overview of features, please see
Newly optional dependenciesCertain inter-module dependencies are now optional at the
Maven POM level where they were once required. For example, spring-tx
and its dependence on spring-context. This may result in
ClassNotFoundErrors or other similar problems for users that have been relying
on transitive dependency management to pull in affected downstream spring-*
. To resolve this problem, simply add the appropriate missing jars to your
build configuration.EHCache support moved to spring-context-supportAlong with Spring's new JCache support, the EHCache support classes in the
org.springframework.cache.ehcache package moved from the
spring-context module to spring-context-support.Inlining of spring-asm jarIn versions 3.0 and 3.1, we published a discrete spring-asm
containing repackaged org.objectweb.asm 3.x sources. As of Spring
Framework 3.2, we have upgraded to org.objectweb.asm 4.0 and done
away with the separate module jar, favoring inlining these classes directly within
spring-core. This should cause no migration issue for most users;
but on the off chance that you have spring-asm declared directly
within your project's build script, you'll want to remove it when upgrading to
Spring Framework 3.2.Explicit CGLIB dependency no longer requiredIn prior versions, users of Spring's subclass-based AOP proxies (e.g. via
proxy-target-class="true") and @Configuration
class support were required to declare an explicit dependency on CGLIB 2.2. As of
Spring Framework 3.2, we now repackage and inline the newly-released CGLIB 3.0.This means greater convenience for users, as well as correct functionality for
Java 7 users who are creating subclass proxies of types that contain
invokedynamic bytecode instructions. Repackaging CGLIB internally ensures
no classpath conflicts with other third party frameworks that may depend on other
versions of CGLIB.For OSGi usersOSGi metadata is no longer published within individual Spring Framework
jar MANIFEST.MF files. Please see this
announcement
for more information about how users can get OSGi-ready versions of Spring
Framework 3.2 jars.MVC Java Config and MVC NamespaceAs explained in , both
the MVC Java config and the MVC namespace register extensions such as
.json and .xml if the
corresponding classpath dependencies are present. That means controller
methods may now return JSON or XML formatted content if those
extensions are present in the request URI,
even if the 'Accept' header doesn't request those media types.The newly added support for matrix variables is explained in
. To preserve backward
compatibility, by default, semicolon content is removed from incoming
request URIs and therefore @MatrixVariable
cannot be used without additional configuration. However, when using
the MVC Java config and the MVC namespace, semicolon content is left
in the URI so that matrix variables are automatically supported.
The removal of semicolon content is controlled through the
UrlPathHelper property of
RequestMappingHandlerMapping.Decoding of URI Variable ValuesURI variable values now get decoded when
UrlPathHelper.setUrlDecode is set to false.
See SPR-9098.HTTP PATCH methodThe DispatcherServlet now allows the
HTTP PATCH method where previously it didn't.Tiles 3Besides the version number change, the set of Tiles
dependencies has also changed. You will need to have a subset or all of
tiles-request-api, tiles-api,
tiles-core, tiles-servlet,
tiles-jsp, tiles-el.
Spring MVC Test standalone projectIf migrating from the
spring-test-mvc
standalone project to the spring-test module in
Spring Framework 3.2, you will need to adjust the root package
to be org.springframework.test.web.servlet.You will no longer be able to use the
MockMvcBuildersannotationConfigSetup
and xmlConfigSetup options. Instead you'll need to switch
to using the @WebApplicationContext support
of spring-test for loading Spring configuration,
then inject a WebApplicationContext into
the test and use it to create a MockMvc.
for details.Spring Test DependenciesThe spring-test module has been upgraded to
depend on JUnit 4.11 (junit:junit), TestNG 6.5.2
(org.testng:testng), and Hamcrest Core 1.3
(org.hamcrest:hamcrest-core). Each of these
dependencies is declared as an optional dependency
in the Maven POM. Furthermore, it is important to note that the JUnit
team has stopped inlining Hamcrest Core within the
junit:junit Maven artifact as of JUnit 4.11. Thus, if
your existing JUnit-based tests make use of Hamcrest matchers that were
previously available directly within the junit:junit
JAR, you will now need to explicitly declare a dependency on
org.hamcrest:hamcrest-core,
org.hamcrest:hamcrest-library, or
org.hamcrest:hamcrest-all.Public API changesJDiff reports
Select JDiff reports are now being published to provide users with a convenient
means of understanding what's changed between versions. Going forward these will be
published between each minor version, e.g. from 3.1.3.RELEASE to 3.1.4.RELEASE; from
the latest maintenance version to the latest GA release, e.g.
3.1.3.RELEASE to 3.2.0.RELEASE; and in between each milestone
and/or RC for users who are tracking next-generation development, e.g.
3.2.0.RC2 to 3.2.0.RELEASE.
DeprecationsThe following packages and types have been wholly or partially deprecated
in Spring Framework 3.2 and may be removed in a future version. Click through
to the linked Javadoc for each item for exact details. See also the
complete list of deprecations in the framework.
org.springframework.orm.ibatis
org.springframework.scheduling.backportconcurrent
org.springframework.ejb.support
org.springframework.http.converter.xml.XmlAwareFormHttpMessageConverter
org.springframework.web.jsf.DelegatingVariableResolver
org.springframework.web.jsf.SpringBeanVariableResolver
org.springframework.ui.velocity.CommonsLoggingLogSystem
org.springframework.ui.velocity.VelocityEngineUtils
org.springframework.beans.factory.config.BeanReferenceFactoryBean
org.springframework.beans.factory.config.CommonsLogFactoryBean
org.springframework.beans.instrument.classloading.oc4j.OC4JLoadTimeWeaver
org.springframework.transaction.jta.OC4JJtaTransactionManager
org.springframework.web.util.ExpressionEvaluationUtils
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
org.springframework.web.servlet.mvc.annotation.ServletAnnotationMappingUtils
org.springframework.jmx.support.MBeanRegistrationSupport
org.springframework.test.context.ContextConfigurationAttributes
org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests:
use of the simpleJdbcTemplate instance variable has been deprecated
in favor of the new jdbcTemplate instance variable.
org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests:
use of the simpleJdbcTemplate instance variable has been deprecated
in favor of the new jdbcTemplate instance variable.
org.springframework.test.jdbc.SimpleJdbcTestUtils has been deprecated in
favor of JdbcTestUtils which now contains all of the
functionality previously available in SimpleJdbcTestUtils.
org.springframework.web.servlet.view.ContentNegotiatingViewResolver
org.springframework.transaction.interceptor.TransactionAspectUtils
org.springframework.http.HttpStatus
org.springframework.web.util.UriUtils
org.springframework.orm.jpa.vendor.TopLinkJpaDialect
org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter
org.springframework.orm.util.CachingMapDecorator