ehcache在生产环境中失败了

时间:2013-02-18 12:34:38

标签: spring hibernate networking spring-mvc centos

我正在开发以下版本的SpringMVC应用程序:

Spring 3.2.0, Hibernate 3.6.9

Echache

它在Tomcat 6.18的Windows环境中正常工作(在开发中),但是当我们部署到生产环境(Cent OS)时,它会出现以下错误并且部署失败。

我确切地知道根本原因。

2013-02-18 12:42:16,941 -  - Unable to set localhost. This prevents creation of a GUID. Cause was: static-182-18-145-83.ctrls.in: static-182-18-145-83.ctrls.in
java.net.UnknownHostException: static-182-18-145-83.ctrls.in: static-182-18-145-83.ctrls.in
    at java.net.InetAddress.getLocalHost(InetAddress.java:1360)
    at net.sf.ehcache.Cache.<clinit>(Cache.java:200)
    at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:302)
    at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:218)
    at net.sf.ehcache.CacheManager.configure(CacheManager.java:599)
    at net.sf.ehcache.CacheManager.init(CacheManager.java:358)
    at net.sf.ehcache.CacheManager.<init>(CacheManager.java:272)
    at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:134)
    at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:238)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:286)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)

1 个答案:

答案 0 :(得分:0)

这与hostname

有关
127.0.0.1   work        localhost

到你的/ etc / hosts文件

你可以通过执行

来做到这一点

sudo bash

echo "127.0.0.1 localhost mynap3" >> /etc/hosts