在启动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. 【leetcode】1184. Distance Between Bus Stops

    题目如下: A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between al ...

  2. net core 下 接受文件 测试

    /* IFormFileCollection Files 再Request对象下的From对象下的Files对象 public interface IFormFileCollection : IRea ...

  3. 以Emacs Org mode为核心的任务管理方案

    前言 如今用于任务管理的方法与工具越来越多,如纸笔系统.日历与任务列表.Emacs Org mode系统,以及移动设备上的诸多应用.这些解决方案各具特色,在一定程度上能够形成互补作用.但是,它们彼此之 ...

  4. Spring Cloud架构教程 (一)Hystrix监控面板

    下面我们基于之前的示例来结合Hystrix Dashboard实现Hystrix指标数据的可视化面板,这里我们将用到下之前实现的几个应用,包括: eureka-server:服务注册中心 eureka ...

  5. Maven构建生命周期

    以下引用官方的生命周期解释https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html: 一.构建生命 ...

  6. 企业链表C语言实现

    /* * LinkList.h * * Created on: 2019年7月20日 * Author: Administrator */ #ifndef SRC_LINKLIST_H_ #defin ...

  7. @清晰掉 sprintf sscanf双胞胎

    sprintf() 格式化输出函数(图形) 功能: 函数sprintf()用来作格式化的输出.用法: 此函数调用方式为int sprintf(char *string,char *format,arg ...

  8. lr_save_string和sprintf、lr_eval_string的使用

    一.lr_save_string函数 1.该函数主要是将程序中的常量或变量保存为参数: //将常量保存为参数 lr_save_string("777","page&quo ...

  9. php curl http digest

    php用curl访问有http digest验证的网址时,不能直接加在URL上,例如: http://user:pass@xxx.xxx.xxx.xxx/index.php?a=1&b=2 这 ...

  10. ACE官网

    ACE的官网是http://www.dre.vanderbilt.edu/~schmidt/ACE.html 文档的官网是https://htmlpreview.github.io/?https:// ...