V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
FinalDream
V2EX  ›  Java

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

  •  
  •   FinalDream · 2013-12-19 23:37:48 +08:00 · 4972 次点击
    这是一个创建于 3996 天前的主题,其中的信息可能已经有所发展或是发生改变。
    把一个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
    tonic
        1
    tonic  
       2013-12-19 23:42:56 +08:00   ❤️ 1
    Could not create cache directory "/ehcache".

    权限问题?
    66CCFF
        2
    66CCFF  
       2013-12-20 01:00:57 +08:00
    楼上+1
    好像是目录权限问题= =》
    FinalDream
        3
    FinalDream  
    OP
       2013-12-21 22:59:44 +08:00
    @tonic
    @66CCFF
    貌似不是权限的问题,我给目录赋予了权限
    我从SVN上下了三个项目,一个没使用Maven的正常,两个使用Maven的出现如上问题,这些项目在Windows下都能正常运行
    FinalDream
        4
    FinalDream  
    OP
       2013-12-22 18:47:31 +08:00
    折腾一夜没找到原因,结果今天又自己正常了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1462 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:13 · PVG 01:13 · LAX 09:13 · JFK 12:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.