问题描述
当工程所有都配置完成之后,我们运行Shiro项目,发现并不能运行成功,报错信息如下所示.
***************************
APPLICATION FAILED TO START
***************************
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).
原因
这是因为我们没有配置INI文件
解决办法
根据提示在resources或者src/main/resources/META-INF文件夹下创建一个名为shiro.ini的文件.并且添加我们的用户验证信息.如下图所示


本文详细解析了在Shiro项目中遇到的Nobean of type 'Realm' found错误,阐述了错误产生的原因,并提供了具体的解决办法。通过在资源目录下创建shiro.ini文件并配置用户验证信息,有效解决了项目无法启动的问题。
1094





