Disable Ehcaches UpdateChecker in Grails application

I found it pretty annoying that Ehcache always reminded me that there is an update to a newer version of its framework available. After searching the web I found an interesting thread in the Terracotta forum saying that the UpdateChecker is not only looking for updates. In addition it also submits information about the applications environment to Terracotta by default. And that is not a good thing in my opinion.

Here you can see youself: http://svn.terracotta.org/svn/ehcache/trunk/core/src/main/java/net/sf/ehcache/util/UpdateChecker.java

Fortunately you can disable this behavior by adding an Ehcache configuration to your Grails application. I have tested this with a Grails 1.2.0 application which includes Ehcache 1.7.1.

Simply place an ehcache.xml file in your <app-root>/grails-app/conf folder containing your Ehcache configuration. For this post I am using the configuration that ships with Ehcache as default (ehcache-failsafe.xml) and modify it.

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false">

    <diskStore path="java.io.tmpdir"/>

    <defaultCache
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            overflowToDisk="true"
            maxElementsOnDisk="10000000"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            />

</ehcache>

With the attribute updateCheck=”false” in the root tag the haunting is gone.

XML Schema for Ehcache config can be found here: http://ehcache.org/ehcache.xsd

More Information about Ehcache configuration: http://ehcache.org/documentation/configuration.html

About Sven Lange

I am a software engineer at Orientation in Objects in Mannheim (Germany) whose scope is mainly on web development related stuff.
This entry was posted in Grails and tagged , . Bookmark the permalink.

6 Responses to Disable Ehcaches UpdateChecker in Grails application

  1. Peter Doornbosch says:

    Nice to know this. Thanks for posting!

  2. John Rellis says:

    mucho appreciated!

  3. Gosta says:

    Do you know how this can be done programmatically?

  4. Sven Lange says:

    With todays release of Grails 1.2.2 this is nomore necessary. The Grails dev team disabled the UpdateChecker by default.

    http://jira.codehaus.org/browse/GRAILS-5949
    http://www.grails.org/1.2.2+Release+Notes

  5. Pingback: Ehcache Java library’s UpdateChecker == spyware « Logiciel Libre

  6. Adam Monsen says:

    Wow, mucho badness, Terracotta! Thanks for sharing this, Sven.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>