把项目迁移到Mac就报错是怎么回事?

2013-12-19 23:37:48 +08:00
 FinalDream
把一个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
4995 次点击
所在节点    Java
4 条回复
tonic
2013-12-19 23:42:56 +08:00
Could not create cache directory "/ehcache".

权限问题?
66CCFF
2013-12-20 01:00:57 +08:00
楼上+1
好像是目录权限问题= =》
FinalDream
2013-12-21 22:59:44 +08:00
@tonic
@66CCFF
貌似不是权限的问题,我给目录赋予了权限
我从SVN上下了三个项目,一个没使用Maven的正常,两个使用Maven的出现如上问题,这些项目在Windows下都能正常运行
FinalDream
2013-12-22 18:47:31 +08:00
折腾一夜没找到原因,结果今天又自己正常了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/93864

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX