org.springframework.beans.MethodInvocationException: Property 'cacheManager' threw exception; neste

Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'cacheManager' threw exception; nested exception is org.apache.shiro.cache.CacheException: net.sf.ehcache.CacheException: Caches cannot be added by name when default cache config is not specified in the config. Please add a default cache config in the configuration.
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:108)
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:62)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1489)
	... 33 more

七月 04, 2016 4:06:11 下午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
七月 04, 2016 4:06:11 下午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/shiroWeb] startup failed due to previous errors
七月 04, 2016 4:06:11 下午 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
七月 04, 2016 4:06:11 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/shiroWeb] appears to have started a thread named [net.sf.ehcache.CacheManager@48050] but has failed to stop it. This is very likely to create a memory leak.
七月 04, 2016 4:06:11 下午 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive D:\apache\tomcat\7\x32\apache-tomcat-7.0.39\webapps\TestEEProject.war
七月 04, 2016 4:06:11 下午 org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\apache\tomcat\7\x32\apache-tomcat-7.0.39\webapps\TestEEProject\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
七月 04, 2016 4:06:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache\tomcat\7\x32\apache-tomcat-7.0.39\webapps\docs
七月 04, 2016 4:06:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache\tomcat\7\x32\apache-tomcat-7.0.39\webapps\examples
七月 04, 2016 4:06:11 下午 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
七月 04, 2016 4:06:11 下午 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
七月 04, 2016 4:06:11 下午 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@5e9a70')
七月 04, 2016 4:06:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache\tomcat\7\x32\apache-tomcat-7.0.39\webapps\host-manager
七月 04, 2016 4:06:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache\tomcat\7\x32\apache-tomcat-7.0.39\webapps\manager
七月 04, 2016 4:06:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache\tomcat\7\x32\apache-tomcat-7.0.39\webapps\ROOT
七月 04, 2016 4:06:11 下午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
七月 04, 2016 4:06:11 下午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
七月 04, 2016 4:06:11 下午 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1935 ms
七月 04, 2016 4:06:12 下午 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already.  Could not load net.sf.ehcache.util.ProductInfo.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1599)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
	at net.sf.ehcache.util.UpdateChecker.buildParamsString(UpdateChecker.java:125)
	at net.sf.ehcache.util.UpdateChecker.buildUpdateCheckUrl(UpdateChecker.java:121)
	at net.sf.ehcache.util.UpdateChecker.doCheck(UpdateChecker.java:69)
	at net.sf.ehcache.util.UpdateChecker.checkForUpdate(UpdateChecker.java:60)
	at net.sf.ehcache.util.UpdateChecker.run(UpdateChecker.java:51)
	at java.util.TimerThread.mainLoop(Unknown Source)
	at java.util.TimerThread.run(Unknown Source)


环境:spring3 + springMvc + shiro + ehcache

ehcache.xml错误的配置

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
   xsi:noNamespaceSchemaLocation="ehcache.xsd">  
  <diskStore path="java.io.tmpdir"/>      
    <!-- 登录记录缓存 锁定10分钟 -->
    <cache name="passwordRetryCache"
           maxEntriesLocalHeap="2000"
           eternal="false"
           timeToIdleSeconds="3600"
           timeToLiveSeconds="0"
           overflowToDisk="false"
           statistics="true">
    </cache>
</ehcache>


应该增加默认的ehcache

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
   xsi:noNamespaceSchemaLocation="ehcache.xsd">  
  <diskStore path="java.io.tmpdir"/>  
  <defaultCache  
    maxElementsInMemory="10000"  
    maxElementsOnDisk="0"  
    eternal="true"  
    overflowToDisk="true"  
    diskPersistent="false"  
    timeToIdleSeconds="0"  
    timeToLiveSeconds="0"  
    diskSpoolBufferSizeMB="50"  
    diskExpiryThreadIntervalSeconds="120"  
    memoryStoreEvictionPolicy="LFU"  
    />
    
    <!-- 登录记录缓存 锁定10分钟 -->
    <cache name="passwordRetryCache"
           maxEntriesLocalHeap="2000"
           eternal="false"
           timeToIdleSeconds="3600"
           timeToLiveSeconds="0"
           overflowToDisk="false"
           statistics="true">
    </cache>
</ehcache>






posted @ 2016-07-04 16:11  Bug开发攻城狮  阅读(1886)  评论(0编辑  收藏  举报