zoukankan      html  css  js  c++  java
  • Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'异常解决方案

    解决方案:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context.xsd
           http://www.springframework.org/schema/mvc
           http://www.springframework.org/schema/mvc/spring-mvc.xsd">

    错误原因1:

    http://www.springframework.org/schema/mvc/spring-mvc.xsd这个
    之前IDEA在spring-mvc后面自动加了版本号(好像是3.1.2),删了就可以了

     错误原因2:

      有关mvc的包选择错了,当时IDEA自动导入了

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

    把这两个换成
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd

    就可以了

    Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0’


    spring配置文件添加注解扫描<mvc:annotation-driven />之后,idea会自动给你添加引用,但是它添加的引用是xmlns:mvc=”http://www.springframework.org/schema/cache”,这就导致了问题。应该把它改成xmlns:mvc=”http://www.springframework.org/schema/mvc”

     
  • 相关阅读:
    你必须知道的495个C语言问题,学习体会四
    ++操作符重载代码分析
    正斜杠 与反斜杠之争
    文件操作基础入门
    你必须知道的495个C语言问题,学习体会三
    你必须知道的495个C语言问题,学习体会二
    【皇甫】☀别进来 千万别进来
    【皇甫】☀设计_模式
    【皇甫】☀七个小矮人和一个小博
    【皇甫】☀游戏还有游戏还是游戏
  • 原文地址:https://www.cnblogs.com/mjn1/p/13167368.html
Copyright © 2011-2022 走看看