1.错误背景
1.开发工具:Interiij idea。
2.使用Spring,SpringMVC,MyBatis框架整合实现商品秒杀。
2.错误信息如下
关键错误信息:
Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cacheManager' is defined。
3.解决方法
xml文件中引入的cache命名空间修改为tx。
4.产生原因
Spring的xml文件中使用到tx标签,idea工具默认引入cache命名空间。注意在使用tx标签时修改引用正确的命名空间。