NutzCN Logo
问答 为什么前一天还可以正常的启动,今天就不行了
发布于 2941天前 作者 shusheng 2617 次浏览 复制 上一个帖子 下一个帖子
标签:
9:22:04.447 ERROR (EnvironmentLoader.java:146) initEnvironment - Shiro environment initialization failed
org.apache.shiro.cache.CacheException: net.sf.ehcache.CacheException: Disk store path can't be created: ehcache.disk.store.dir\yvr_cache
	at org.apache.shiro.cache.ehcache.EhCacheManager.ensureCacheManager(EhCacheManager.java:224) ~[shiro-ehcache-1.3.2.jar:1.3.2]
	at org.apache.shiro.cache.ehcache.EhCacheManager.init(EhCacheManager.java:199) ~[shiro-ehcache-1.3.2.jar:1.3.2]
	at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.ReflectionBuilder$BeanConfigurationProcessor.execute(ReflectionBuilder.java:785) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:260) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:167) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:130) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:108) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:94) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203) ~[shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99) ~[shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92) ~[shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40) ~[shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221) ~[shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:133) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4717) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403) [catalina.jar:9.0.0.M11]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) [catalina.jar:9.0.0.M11]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_102]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102]
Caused by: net.sf.ehcache.CacheException: Disk store path can't be created: ehcache.disk.store.dir\yvr_cache
	at net.sf.ehcache.DiskStorePathManager.resolveAndLockIfNeeded(DiskStorePathManager.java:141) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.DiskStorePathManager.getFile(DiskStorePathManager.java:262) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.DiskStorePathManager.getFile(DiskStorePathManager.java:251) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.store.disk.DiskStorageFactory.<init>(DiskStorageFactory.java:127) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.store.disk.DiskStore.create(DiskStore.java:154) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.store.disk.DiskStore.createCacheStore(DiskStore.java:182) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.Cache.initialise(Cache.java:1216) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1370) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1436) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:832) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.CacheManager.doInit(CacheManager.java:500) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.CacheManager.init(CacheManager.java:395) ~[ehcache-2.10.1.jar:2.10.1]
	at net.sf.ehcache.CacheManager.<init>(CacheManager.java:356) ~[ehcache-2.10.1.jar:2.10.1]
	at org.apache.shiro.cache.ehcache.EhCacheManager.ensureCacheManager(EhCacheManager.java:213) ~[shiro-ehcache-1.3.2.jar:1.3.2]
	... 29 more
8 回复

改ehcache.xml里面的路径

@wendal 这个路径填写我自己电脑的路径吗,这个路径代表的是什么意思,创建缓存区吗?

@wendal 这个路径填写我自己电脑的路径吗,这个路径代表的是什么意思,创建缓存区吗?

@wendal 这个路径填写我自己电脑的路径吗,这个路径代表的是什么意思,创建缓存区吗?

ehcache.disk.store.dir是ehcache会读取的环境变量名称

如果它在环境变量中找到ehcache.disk.store.dir的值,就会替换掉, 没找到的保持原样. 这点在生产环境上比较重要, 部署的时候配置一下环境变量完事

@wendal 路径改到d盘下后又报错了

<diskStore path="d:\\ehcache" />

Unable to instantiate class [net.wendal.nutzbook.shiro.cache.RedisCacheManager] for object named 'cacheManager_redis'.

重启了eclipse,工程正常了

添加回复
请先登陆
回到顶部