这是一个创建于 3998 天前的主题,其中的信息可能已经有所发展或是发生改变。
把一个Web项目迁移到Mac下后出现如下错误
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/classes/appContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/appContext.xml]: Invocation of init method failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: org.hibernate.cache.UpdateTimestampsCacheCache: Could not create disk store. Initial cause was Could not create cache directory "/ehcache".
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 24 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/appContext.xml]: Invocation of init method failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: org.hibernate.cache.UpdateTimestampsCacheCache: Could not create disk store. Initial cause was Could not create cache directory "/ehcache".
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 34 more
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: org.hibernate.cache.UpdateTimestampsCacheCache: Could not create disk store. Initial cause was Could not create cache directory "/ehcache".
at org.hibernate.cache.EhCacheProvider.buildCache(EhCacheProvider.java:101)
at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.buildTimestampsRegion(RegionFactoryCacheProviderBridge.java:119)
at org.hibernate.cache.UpdateTimestampsCache.<init>(UpdateTimestampsCache.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:396)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 41 more
Caused by: net.sf.ehcache.CacheException: org.hibernate.cache.UpdateTimestampsCacheCache: Could not create disk store. Initial cause was Could not create cache directory "/ehcache".
at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:164)
at net.sf.ehcache.Cache.createDiskStore(Cache.java:577)
at net.sf.ehcache.Cache.initialise(Cache.java:549)
at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:707)
at net.sf.ehcache.CacheManager.addCache(CacheManager.java:697)
at net.sf.ehcache.CacheManager.addCache(CacheManager.java:634)
at org.hibernate.cache.EhCacheProvider.buildCache(EhCacheProvider.java:94)
... 50 more
Caused by: java.lang.Exception: Could not create cache directory "/ehcache".
at net.sf.ehcache.store.DiskStore.initialiseFiles(DiskStore.java:177)
at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:152)
... 56 more
4 条回复 • 1970-01-01 08:00:00 +08:00
|
|
1
tonic 2013-12-19 23:42:56 +08:00 1
Could not create cache directory "/ehcache".
权限问题?
|
|
|
2
66CCFF 2013-12-20 01:00:57 +08:00
楼上+1 好像是目录权限问题= =》
|
|
|
3
FinalDream 2013-12-21 22:59:44 +08:00
@ tonic @ 66CCFF 貌似不是权限的问题,我给目录赋予了权限 我从SVN上下了三个项目,一个没使用Maven的正常,两个使用Maven的出现如上问题,这些项目在Windows下都能正常运行
|
|
|
4
FinalDream 2013-12-22 18:47:31 +08:00
折腾一夜没找到原因,结果今天又自己正常了
|