在启动Springboot项目时,报错:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available

第一反应是shiroFilter拼写错了。于是检查相关代码:

1、注入过滤器的代码

registration.setFilter(new DelegatingFilterProxy("shiroFilter"));

2、自动注册Bean的代码

    @Bean("shiroFilter")
public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();

发现两个类中shiroFilter的拼写都没有问题。

然后开始debug断点调试。发现代码根本就没有进入自动注册的Bean的代码中。与是检查ShiroConfig的代码,发现类上边少写了@Configuration,好尴尬啊!~

springboot工程启动时,报错:No bean named 'shiroFilter' available的更多相关文章

  1. Springboot2.x 启动报错:Bean named 'xxxService'... but was actually of type 'com.sun.proxy.$Proxy82'

    Springboot 2.0.5 搭建一个新项目启动后报错:Bean named 'xxxService'... but was actually of type 'com.sun.proxy.$Pr ...

  2. springboot 启动报错"No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available"

    1.问题 springboot启动报错 "D:\Program Files\Java\jdk-11\bin\java.exe" -XX:TieredStopAtLevel=1 -n ...

  3. 工程启动没有报错,但是dubbo后台显示没有提供者,工程没有提供服务

    先说一下我遇到的问题:服务工程启动没有异常,消费者工程启动会出现很多nested(嵌套的)错误,但其根本错误是No provider available(缺少服务提供者).可是服务工程起来的时候明明没 ...

  4. intellij idea 新建springboot工程pom.xml报错

    今天使用idea新建的springboot工程pom.xml文件报错如下 1. 问题 'settings.xml' has syntax errors less... (Ctrl+F1) Inspec ...

  5. 启动zuul时候报错:The bean 'proxyRequestHelper', defined in class path resource [org/springframework/cloud/netflix/zuul

    启动zuul时候报错:The bean 'proxyRequestHelper', defined in class path resource [org/springframework/cloud/ ...

  6. Springboot项目 配置数据库连接属性后,启动项目报错

    Springboot项目 配置数据库连接属性后,启动项目报错,错误如下: 错误原因分析: 1.连接信息配置错误 当使用properties为配置文件时,如图所示,上面的 spring.datasour ...

  7. Springboot 启动文件报错,原因是@ComponentScan写成了@ComponentScans

    Springboot 启动文件报错,原因是@ComponentScan写成了@ComponentScans

  8. SpringBoot程序启动时在Oracle数据库中建表充值

    例子工程下载链接:https://files.cnblogs.com/files/xiandedanteng/gatling20200428-1.zip 需求:在工程启动时在Oracle数据库中建表. ...

  9. Spring Boot接入 apollo 后启动 dubbo 报错

    原文地址:https://xobo.org/spring-boot-apollo-dubbo-xml-error/ 某Spring Boot项目接入 apollo 后启动 dubbo 报错Caused ...

随机推荐

  1. Python---面向对象的三大特征

    # 面向对象的三大特征 - 继承 - 封装 - 多态 # 继承 - 子类可以使用父类定义的内容或者行为等 - 继承的实现 - 父类:基类,超类:被继承的类, Base Class, Super Cla ...

  2. 【NOIP2016提高A组模拟8.15】Garden

    题目 分析 其实原题就是[cqoi2012][bzoj2669]局部极小值. 有一个n行m列的整数矩阵,其中1到nm之间的每个整数恰好出现一次.如果一个格子比所有相邻格子(相邻是指有公共边或公共顶点) ...

  3. Python 日期和时间Ⅱ

    获取某月日历 Calendar模块有很广泛的方法用来处理年历和月历,例如打印某月的月历: 以上实例输出结果: Time 模块 Time 模块包含了以下内置函数,既有https://www.xuanhe ...

  4. 通过页面名字调用页面并添加到tab控件中

    /// <summary> /// 动态 显示 tab /// </summary> /// <param name="sFromName">类 ...

  5. 页面渲染机制(一、DOM和CSSOM树的构建)

    1.HTML的加载 HTML是一个网页的基础,下载完成后解析 2.其他静态资源加载 解析HTML时,发现其中有其他外部资源链接比如CSS.JS.图片等,会立即启用别的线程下载. 但当外部资源是JS时, ...

  6. npm 安装与卸载模块

    1. 只卸载模块 由于之前安装过,在 package.json 中的记录仍然存在 npm uninstall lodash 2. --save 参数使用 卸载模块的同时删除在 package.json ...

  7. Python常用的库简单介绍一下

    Python常用的库简单介绍一下fuzzywuzzy ,字符串模糊匹配. esmre ,正则表达式的加速器. colorama 主要用来给文本添加各种颜色,并且非常简单易用. Prettytable ...

  8. Python的 counter内置函数,统计文本中的单词数量

    counter是 colletions内的一个类 可以理解为一个简单的计数 import collections str1=['a','a','b','d'] m=collections.Counte ...

  9. &&的运算顺序

    先判断“&&”左侧的表达式,左侧的表达式为真时,再运算右侧的表达式.如左侧为假,则不运算右侧.

  10. lr中用C语言比较两个字符串变量

    以下脚本,定义两个一样的字符数组,对比后,打印出result的值: Action() { int result; char string1[] = "We can see the strin ...