ehcache报告UnknownHostException错误

报错如下:

java.net.UnknownHostException: 主机名: 主机名
at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
at net.sf.ehcache.Cache.<clinit>(Cache.java:145)
at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:452)
at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:368)
at net.sf.ehcache.CacheManager.configure(CacheManager.java:321)
at net.sf.ehcache.CacheManager.init(CacheManager.java:237)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:210)
at org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:113)
at or

原因:
encache源码:

static {
try {
localhost = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
LOG.log(Level.SEVERE, "Unable to set localhost. This prevents creation of a GUID. Cause was: " + e.getMessage(), e);
} catch (java.lang.NoClassDefFoundError e) {
LOG.log(Level.FINE, "InetAddress is being blocked by your runtime environment. e.g. Google App Engine." +
" Ehcache will work as a local cache.");
}
}


解决办法:
有可能是本地机器配置的域名解析Host配置有错误!!!我们应用中是这样引起的,也有可能是其他原因引起,要以实际情况为准!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值