JAVA中报错 : org.springframework.beans.factory.BeanCreationException

一、错误类型

org.springframework.beans.factory.BeanCreationException: 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' available

错误类型截图:

二、错误原因

可以造成此类问题的原因有很多,只能讲一下本人造成以上错误的原因

问题出现在  resources文件夹下的 applicationContext.xml 配置文件中

 如上图所示,初学者容易犯的错误之一

三、解决办法

xmlns:mvc="http://www.springframework.org/schema/cache"

改为

xmlns:mvc="http://www.springframework.org/schema/mvc"

希望可以帮助到各位!

 

 

 

posted @ 2021-11-23 21:46  Erudite  阅读(304)  评论(0编辑  收藏  举报