springboot工程启动时,报错:No bean named 'shiroFilter' available
在启动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的更多相关文章
- 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 ...
- 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 ...
- 工程启动没有报错,但是dubbo后台显示没有提供者,工程没有提供服务
先说一下我遇到的问题:服务工程启动没有异常,消费者工程启动会出现很多nested(嵌套的)错误,但其根本错误是No provider available(缺少服务提供者).可是服务工程起来的时候明明没 ...
- intellij idea 新建springboot工程pom.xml报错
今天使用idea新建的springboot工程pom.xml文件报错如下 1. 问题 'settings.xml' has syntax errors less... (Ctrl+F1) Inspec ...
- 启动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/ ...
- Springboot项目 配置数据库连接属性后,启动项目报错
Springboot项目 配置数据库连接属性后,启动项目报错,错误如下: 错误原因分析: 1.连接信息配置错误 当使用properties为配置文件时,如图所示,上面的 spring.datasour ...
- Springboot 启动文件报错,原因是@ComponentScan写成了@ComponentScans
Springboot 启动文件报错,原因是@ComponentScan写成了@ComponentScans
- SpringBoot程序启动时在Oracle数据库中建表充值
例子工程下载链接:https://files.cnblogs.com/files/xiandedanteng/gatling20200428-1.zip 需求:在工程启动时在Oracle数据库中建表. ...
- Spring Boot接入 apollo 后启动 dubbo 报错
原文地址:https://xobo.org/spring-boot-apollo-dubbo-xml-error/ 某Spring Boot项目接入 apollo 后启动 dubbo 报错Caused ...
随机推荐
- 容器"共享"宿主机的hosts文件(终极方案)
0.背景 有时候制作docker镜像生成容器时需要宿主机的hosts文件共享到容器中.首先想的是通过挂载的方式共享hosts文件,但是实践时发现根本行不通,hosts文件在/etc/目录下,如进行挂载 ...
- c++linux多线程基础知识
http://blog.csdn.net/lovecodeless/article/details/24929273 http://blog.csdn.net/Jiangweihll/article/ ...
- IDC机房跳线
服务网卡口与配线架 这里有一根网线 记录方式 签 A:23FM-23U-T07 (配线架网线) B:23FM-23U-NIC1(服务器网线) 在配线架的机柜旁边一定写明了 跳线的对面的 交换和配线 ...
- docker开启远程tcp监听端口
linux 测试成功 cat > /etc/systemd/system/docker.service.d/tcp.conf <<EOF [Service] ExecStart= E ...
- jquery odd选择器 语法
jquery odd选择器 语法 作用::odd 选择器选取每个带有奇数 index 值的元素(比如 1.3.5).index 值从 0 开始,所有第一个元素是偶数 (0).最常见的用法:与其他元素/ ...
- 实战build-react(四)一个模块的进化过程
主框架结构 home/index.js //模块主文件 创建Topic模块 阶段一 基础代码 import React, { Component } from 'react'; import ...
- 箱排序(Bin Sort)
1.基本思想 排序过程无须比较关键字,而是通过"分配"和"收集"过程来实现排序.它们的时间复杂度可达到线性阶:O(n). 箱排序也称桶排序(Bucket Sor ...
- ASP.NET MVC 生成EML文件
需求: 点发送邮件按钮的时候, 自动在客户端电脑打开默认邮件的窗口,并且把内容和附件都附加上去. 解决方案: 尝试使用过Microsoft.Office.Interop.Outlook 和 MPAI. ...
- 【BZOJ4195】 [Noi2015]程序自动分析
Description 在实现程序自动分析的过程中,常常需要判定一些约束条件是否能被同时满足. 考虑一个约束满足问题的简化版本:假设x1,x2,x3,…代表程序中出现的变量,给定n个形如xi=xj或x ...
- [python] Pythonic语法笔记
Pythonic语法笔记 __new__ 在类实例化之前执行的,也就是在init之前执行,可以为这个类写操作.接受的参数不是self而是cls.只有在new方法里返回类才会执行init操作,需要返回父 ...