设置Grails分布式缓存的ehcacheMulticastGroupAddress出错

时间:2015-01-14 22:16:56

标签: java grails caching ehcache

我正在测试Grails Ehcache插件的分布式缓存,尝试在不同的端口上运行同一应用程序的两个不同版本。

在BuildConfig中我有:

plugins {
    // plugins for the build system only
    build ":tomcat:7.0.55"

    // plugins for the compile step
    compile ":cache-ehcache:1.0.4"

    // plugins needed at runtime but not for compilation
    runtime ":hibernate4:4.3.6.1" 
    runtime ":database-migration:1.4.0"
    runtime ":jquery:1.11.1"

}

应用程序将运行并正确缓存域对象。

当我将以下配置添加到Config.groovy或CacheConfig.groovy(并通过grails.config.locations包含它)时,我收到以下错误:

Message: Could not create CacheManagerPeerProvider. Initial cause was ${ehcacheMulticastGroupAddress}
    Line | Method
->>   63 | createCachePeerProvider  in net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    136 | createCachePeerProviders in net.sf.ehcache.config.ConfigurationHelper
|    795 | configure . . . . . . .  in net.sf.ehcache.CacheManager
|    471 | doInit                   in     ''
|    395 | init . . . . . . . . . . in     ''
|    177 | rebuild                  in grails.plugin.cache.ehcache.GrailsEhCacheManagerFactoryBean$ReloadableCacheManager
|     63 | reload . . . . . . . . . in grails.plugin.cache.ehcache.EhcacheConfigLoader
|     42 | reload                   in grails.plugin.cache.ConfigLoader
|    204 | reloadCaches . . . . . . in CacheGrailsPlugin
|    161 | doCall                   in CacheGrailsPlugin$_closure3
|    334 | innerRun . . . . . . . . in java.util.concurrent.FutureTask$Sync
|    166 | run                      in java.util.concurrent.FutureTask
|   1145 | runWorker . . . . . . .  in java.util.concurrent.ThreadPoolExecutor
|    615 | run                      in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . . . . . .  in java.lang.Thread

Caused by UnknownHostException: ${ehcacheMulticastGroupAddress}
->>  894 | lookupAllHostAddr        in java.net.InetAddress$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   1286 | getAddressesFromNameService in java.net.InetAddress
|   1239 | getAllByName0 . . . . .  in     ''
|   1155 | getAllByName             in     ''
|   1091 | getAllByName . . . . . . in     ''
|   1041 | getByName                in     ''
|    113 | createAutomaticallyConfiguredCachePeerProvider in net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory
|     61 | createCachePeerProvider  in     ''
|    136 | createCachePeerProviders in net.sf.ehcache.config.ConfigurationHelper
|    795 | configure                in net.sf.ehcache.CacheManager
|    471 | doInit . . . . . . . . . in     ''
|    395 | init                     in     ''
|    177 | rebuild . . . . . . . .  in grails.plugin.cache.ehcache.GrailsEhCacheManagerFactoryBean$ReloadableCacheManager
|     63 | reload                   in grails.plugin.cache.ehcache.EhcacheConfigLoader
|     42 | reload . . . . . . . . . in grails.plugin.cache.ConfigLoader
|    204 | reloadCaches             in CacheGrailsPlugin
|    161 | doCall . . . . . . . . . in CacheGrailsPlugin$_closure3
|    334 | innerRun                 in java.util.concurrent.FutureTask$Sync
|    166 | run . . . . . . . . . .  in java.util.concurrent.FutureTask
|   1145 | runWorker                in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run                      in java.lang.Thread

1 个答案:

答案 0 :(得分:0)

您的Ehcache配置看起来有一个未解析的变量:${ehcacheMulticastGroupAddress}