ehcachemulticastgroupaddress设置grails分布式缓存时出错

eivgtgni  于 2021-06-30  发布在  Java
关注(0)|答案(1)|浏览(363)

我正在测试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
wfsdck30

wfsdck301#

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

相关问题