Spring2.5集成ehcache,ehcache的版本问题

使用Spring2.5集成ehcache
	<bean id="cacheManager"
		class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
		<property name="configLocation">
			<value>file:server/ehcache.xml</value>
		</property>
	</bean>

总是报错:
...
Caused by: java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue
	at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:418)
	at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:334)
	at net.sf.ehcache.CacheManager.configure(CacheManager.java:306)
	at net.sf.ehcache.CacheManager.init(CacheManager.java:226)
	at net.sf.ehcache.CacheManager.<init>(CacheManager.java:202)
	at org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:113)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)
	... 46 more
Caused by: java.lang.ClassNotFoundException: edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 54 more


换了几个版本的ehcache.jar后,发现只有1.5的版本不报错!
大家使用的时候要注意了!

你可能感兴趣的:(java,.net,cache,Security,sun)