springboot整合shiro的时候出现了报错

报错信息:

Description:

No bean of type 'org.apache.shiro.realm.Realm' found.

Action:

Please create bean of type 'Realm' or add a shiro.ini in the root classpath (src/main/resources/shiro.ini) or in the META-INF folder (src/main/resources/META-INF/shiro.ini).

Disconnected from the target VM, address: '127.0.0.1:61129', transport: 'socket'

Process finished with exit code 1

原因:我的配置类和自定义的realm类忘了加相应的注解,没有注入到spring的容器中,因此报错。
解决方法:加上相应注解

在这里插入图片描述

![在这里插入图片描述](https://img-blog.csdnimg.cn/3f2b745048dc49ca9c5d5c99c4237b0d.png

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐