Java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManag

摘要:在做spring整合ehcache配置的时候出现了下面的错误,提示如下:Java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean,经过检查发现是因为org.springframework.cache.ehcache.EhCacheManagerFactoryBean包是从spring-context-support.jar引入的,所有还需要引入该jar才行,否则还是找不到该类。

一:错误信息如下:

  1. T E S T S  
  2. -------------------------------------------------------  
  3. Running com.microcampus.ehcache.test.EhcacheTest  
  4. log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner).  
  5. log4j:WARN Please initialize the log4j system properly.  
  6. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.  
  7. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.707 sec <<< FAILURE!  
  8. test(com.microcampus.ehcache.test.EhcacheTest)  Time elapsed: 0.015 sec  <<< ERROR!  
  9. java.lang.IllegalStateException: Failed to load ApplicationContext  
  10.     at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)  
  11.     at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)  
  12.     at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)  
  13.     at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)  
  14.     at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)  
  15.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)  
  16.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252)  
  17.     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)  
  18.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254)  
  19.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)  
  20.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)  
  21.     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)  
  22.     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)  
  23.     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)  
  24.     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)  
  25.     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)  
  26.     at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)  
  27.     at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)  
  28.     at org.junit.runners.ParentRunner.run(ParentRunner.java:300)  
  29.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)  
  30.     at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)  
  31.     at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)  
  32.     at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)  
  33.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  34.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
  35.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
  36.     at java.lang.reflect.Method.invoke(Method.java:497)  
  37.     at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)  
  38.     at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)  
  39.     at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)  
  40.     at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)  
  41.     at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)  
  42. Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.cache.ehcache.EhCacheManagerFactoryBean] for bean with name 'cacheManager' defined in class path resource [applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean  
  43.     at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328)  
  44.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622)  
  45.     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591)  
  46.     at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1397)  
  47.     at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:968)  
  48.     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)  
  49.     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)  
  50.     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)  
  51.     at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)  
  52.     at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)  
  53.     at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)  
  54.     at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)  
  55.     at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)  
  56.     at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)  
  57.     ... 31 more  
  58. Caused by: java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean  
  59.     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)  
  60.     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)  
  61.     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)  
  62.     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)  
  63.     at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)  
  64.     at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395)  
  65.     at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1349)  
  66.     at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320)  
  67.     ... 44 more  
  68.   
  69.   
  70. Results :  
  71.   
  72. Tests in error:   
  73.   test(com.microcampus.ehcache.test.EhcacheTest): Failed to load ApplicationContext  
  74.   
  75. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0  
Java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManag
T E S T S
-------------------------------------------------------
Running com.microcampus.ehcache.test.EhcacheTest
log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.707 sec <<< FAILURE!
test(com.microcampus.ehcache.test.EhcacheTest)  Time elapsed: 0.015 sec  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
	at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.cache.ehcache.EhCacheManagerFactoryBean] for bean with name 'cacheManager' defined in class path resource [applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1397)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:968)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
	... 31 more
Caused by: java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1349)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320)
	... 44 more


Results :

Tests in error: 
  test(com.microcampus.ehcache.test.EhcacheTest): Failed to load ApplicationContext

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0


重点是这里:Caused by: java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean

二:pom.xml引入的jar如下:

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  2.     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  3.     <modelVersion>4.0.0</modelVersion>  
  4.   
  5.     <groupId>com.microcampus.ehcache</groupId>  
  6.     <artifactId>ehcache</artifactId>  
  7.     <version>0.0.1-SNAPSHOT</version>  
  8.     <packaging>jar</packaging>  
  9.   
  10.     <name>ehcache</name>  
  11.     <url>http://maven.apache.org</url>  
  12.   
  13.     <properties>  
  14.         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
  15.         <springframework.version>4.1.4.RELEASE</springframework.version>  
  16.     </properties>  
  17.   
  18.     <dependencies>  
  19.         <dependency>  
  20.             <groupId>junit</groupId>  
  21.             <artifactId>junit</artifactId>  
  22.             <version>4.10</version>  
  23.             <scope>test</scope>  
  24.         </dependency>  
  25.         <dependency>  
  26.             <groupId>org.springframework</groupId>  
  27.             <artifactId>spring-test</artifactId>  
  28.             <version>${springframework.version}</version>  
  29.             <scope>test</scope>  
  30.         </dependency>  
  31.         <!-- ehcache 2.x核心jar -->  
  32.         <dependency>  
  33.             <groupId>net.sf.ehcache</groupId>  
  34.             <artifactId>ehcache</artifactId>  
  35.             <version>2.10.2</version>  
  36.         </dependency>  
  37.         <!-- ehcache-web主要针对页面缓存 -->  
  38.         <dependency>  
  39.             <groupId>net.sf.ehcache</groupId>  
  40.             <artifactId>ehcache-web</artifactId>  
  41.             <version>2.0.4</version>  
  42.         </dependency>  
  43.         <dependency>  
  44.             <groupId>org.slf4j</groupId>  
  45.             <artifactId>slf4j-log4j12</artifactId>  
  46.             <version>1.7.5</version>  
  47.         </dependency>  
  48.         <dependency>  
  49.             <groupId>log4j</groupId>  
  50.             <artifactId>log4j</artifactId>  
  51.             <version>1.2.17</version>  
  52.         </dependency>  
  53.         <dependency>  
  54.             <groupId>org.springframework</groupId>  
  55.             <artifactId>spring-context</artifactId>  
  56.             <version>${springframework.version}</version>  
  57.         </dependency>  
  58.         <dependency>  
  59.             <groupId>org.springframework</groupId>  
  60.             <artifactId>spring-core</artifactId>  
  61.             <version>${springframework.version}</version>  
  62.         </dependency>  
  63.         <dependency>  
  64.             <groupId>org.springframework</groupId>  
  65.             <artifactId>spring-expression</artifactId>  
  66.             <version>${springframework.version}</version>  
  67.         </dependency>  
  68.         <dependency>  
  69.             <groupId>org.springframework</groupId>  
  70.             <artifactId>spring-beans</artifactId>  
  71.             <version>${springframework.version}</version>  
  72.         </dependency>  
  73.         <dependency>  
  74.             <groupId>org.springframework</groupId>  
  75.             <artifactId>spring-aop</artifactId>  
  76.             <version>${springframework.version}</version>  
  77.         </dependency>  
  78.         <dependency>  
  79.             <groupId>org.springframework</groupId>  
  80.             <artifactId>spring-orm</artifactId>  
  81.             <version>${springframework.version}</version>  
  82.         </dependency>  
  83.         <dependency>  
  84.             <groupId>org.springframework</groupId>  
  85.             <artifactId>spring-web</artifactId>  
  86.             <version>${springframework.version}</version>  
  87.         </dependency>  
  88.         <dependency>  
  89.             <groupId>org.springframework</groupId>  
  90.             <artifactId>spring-webmvc</artifactId>  
  91.             <version>${springframework.version}</version>  
  92.         </dependency>  
  93.         <dependency>  
  94.             <groupId>org.springframework</groupId>  
  95.             <artifactId>spring-oxm</artifactId>  
  96.             <version>${springframework.version}</version>  
  97.         </dependency>  
  98.         <dependency>  
  99.             <groupId>org.springframework</groupId>  
  100.             <artifactId>spring-context-support</artifactId>  
  101.             <version>${springframework.version}</version>  
  102.         </dependency>  
  103.         <dependency>  
  104.             <groupId>cglib</groupId>  
  105.             <artifactId>cglib</artifactId>  
  106.             <version>3.2.0</version>  
  107.         </dependency>  
  108.         <dependency>  
  109.             <groupId>asm</groupId>  
  110.             <artifactId>asm</artifactId>  
  111.             <version>3.3</version>  
  112.         </dependency>  
  113.     </dependencies>  
  114. </project>  
Java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManag
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.microcampus.ehcache</groupId>
	<artifactId>ehcache</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>ehcache</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<springframework.version>4.1.4.RELEASE</springframework.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${springframework.version}</version>
			<scope>test</scope>
		</dependency>
		<!-- ehcache 2.x核心jar -->
		<dependency>
			<groupId>net.sf.ehcache</groupId>
			<artifactId>ehcache</artifactId>
			<version>2.10.2</version>
		</dependency>
		<!-- ehcache-web主要针对页面缓存 -->
		<dependency>
			<groupId>net.sf.ehcache</groupId>
			<artifactId>ehcache-web</artifactId>
			<version>2.0.4</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.7.5</version>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-expression</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-oxm</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${springframework.version}</version>
		</dependency>
		<dependency>
			<groupId>cglib</groupId>
			<artifactId>cglib</artifactId>
			<version>3.2.0</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm</artifactId>
			<version>3.3</version>
		</dependency>
	</dependencies>
</project>

引入上面的jar后,再次执行测试命令就可以成功了,最后我把Spring+Ehcache整合实现缓存的Demo上传上来,下载地址如下:

http://download.csdn.net/detail/sxdtzhaoxinguo/9532090

相关推荐