github grails/grails-core v2.5.0
Grails 2.5.0

latest releases: v6.2.0, v4.1.4, v6.1.2...
9 years ago

Update Notes

Grails 2.5.0 highlights

Grails 2.5.0 contains all of the fixes that Grails 2.4.5 contains. Grails 2.5.x will become the maintenance line for Grails 2.x .
The main changes compared to Grails 2.4.x are the dependency changes:

Recommended plugin versions

If you are upgrading from previous versions and you use the hibernate4 plugin, you will need to update the version in BuildConfig:

runtime ':hibernate4:4.3.8.1' // or ':hibernate:3.6.10.19'

recommended tomcat, asset-pipeline, cache and scaffolding plugin versions for Grails 2.5.x :

build ':tomcat:7.0.55.2'
compile ':cache:1.1.8'
compile ':scaffolding:2.1.2'
compile ':asset-pipeline:2.1.5'

For plugins, the recommended release plugin version is 3.1.1:

    plugins {
        build(":release:3.1.1",
              ":rest-client-builder:2.1.1") {
            export = false
        }
    }

The default BuildConfig.groovy for plugins shipped with Grails 2.5.0 has dependency to release plugin 3.1.1 which has problems with Spring 4.1.x. The problem is fixed with release plugin version 3.1.1 and rest-client-builder version 2.1.1 .

If you are using MongoDb GORM, the recommended plugin version is 3.0.3

compile ':mongodb:3.0.3'

Changes in rest-client-builder behaviour

rest-client-builder version compatible with Grails 2.5.0:

compile ':rest-client-builder:2.1.1'

Spring 4.1.x causes a change in rest-client-builder behaviour.
It now comes with org.springframework.http.converter.json.GsonHttpMessageConverter which changes how rest-client-builder behaves. In case of upgrade problems, that converter can be removed from the underlying RestTemplate instance.

example solution:

def restBuilder = new RestBuilder()
restBuilder.restTemplate.messageConverters.removeAll { it.class.name == 'org.springframework.http.converter.json.GsonHttpMessageConverter' }

A better fix is to add an accept method call for specifying the accepted content type. For example:

def responseText = restBuilder.get(someUrl) { accept 'text/plain' }.text

Changes in ehcache version in hibernate plugins

The ehcache version in hibernate plugins has been upgrade to 2.9.0 version of ehcache.
With this version, the defaults for hibernate.cache.region.factory_class have been changed.
New defaults in DataSource.groovy are

//    cache.region.factory_class = 'org.hibernate.cache.SingletonEhCacheRegionFactory' // Hibernate 3
    cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' // Hibernate 4

This change is required for applications that use multiple datasources and have the Hibernate caching enabled.

There might be other changes in ehcache behaviour and configuration since it has been upgraded from 2.4.8 to 2.9.0 version.

ehcache 2.9.0 is more strict about the configuration. ehcache is used in the spring-security-core plugin for caching users. There is a problem reported as GRAILS-12120.
As a workaround to the "net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM." error you can add this config to Config.groovy:

beans {
   cacheManager {
      shared = true
  }
}

hibernate.flush.mode has been fixed

There has been a bug that hibernate.flush.mode setting wasn't used for all locations. Grails 2.4.3 changed the default to "manual", but that setting wasn't used everywhere.
GRAILS-11687 jira issue contains more information about the fixed bug.
This is mentioned in the release notes since some application might be relying on the previous behaviour.

h2 version change

This release ships with com.h2database:h2 version 1.3.176. This version has issues opening files created by previous versions, ref http://osdir.com/ml/h2-database/2014-06/msg00007.html .
The workaround is use a newer/older version of h2.

    dependencies {
        runtime 'com.h2database:h2:1.3.175'   // or 'com.h2database:h2:1.4.186' for most recent
    }

Docs download

Don't miss a new grails-core release

NewReleases is sending notifications on new releases.