zoukankan      html  css  js  c++  java
  • springmvc运行时出现NoSuchBeanDefinitionException异常

    检测异常信息是否出现如下信息:

     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' is defined

    如果是以上异常,,spring配置文件添加注解扫描<mvc:annotation-driven />之后,idea会自动给你添加引用

    xmlns:mvc="http://www.springframework.org/schema/cache",所以会报错。

    解决办法:

    把原来的引用删除 

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

    http://www.springframework.org/schema/cache
    http://www.springframework.org/schema/cache/spring-cache.xsd

    再添加如下xmlns:
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
    当你在运行项目时,问题已解决。
    引自:https://blog.csdn.net/weixin_40086687/article/details/87352993
     
     

      

  • 相关阅读:
    Spark基础
    flink杂记
    算法
    算法小结
    Java内存模型
    LeetCode---Backtracking && DP
    LeetCode---Sort && Segment Tree && Greedy
    LeetCode---Depth-first && Breadth-first
    LeetCode---Bit Manipulation && Design
    MD5
  • 原文地址:https://www.cnblogs.com/hzh-666/p/11123725.html
Copyright © 2011-2022 走看看