gpt4 book ai didi

spring - ehcache在生产环境中失败

转载 作者:行者123 更新时间:2023-12-04 19:32:21 25 4
gpt4 key购买 nike

我正在开发 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)

最佳答案

这与 hostname 有关

127.0.0.1   work        localhost

到您的/etc/hosts 文件

你可以通过执行来做到这一点

须藤重击
echo "127.0.0.1 localhost mynap3" >> /etc/hosts

关于spring - ehcache在生产环境中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14936439/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com