Line argument must contain a key and a value. Only one string token was found.---使用shiro时错误提示
一.问题
在使用shiro框架时遇到:
Line argument must contain a key and a value. Only one string token was found.错误。
二.错的原因
1.ini配置文件的编码问题。
2.jdbcRealm.ini的内容有错。
3.其他(未遇到)
三解决方法:
1.如果是ini配置文件的编码问题。
解决方法:将 .ini 配置文件保存为 ANSI 格式。
用记事本打开,选择“另存为”,编码选择 ANSI 就可以了。
2.关于jdbcRealm.ini内容的错误,错的地方如下图
解决方法:写成dataSource.password = ""
,注:双引号中没有空格。
特别鸣谢:https://blog.csdn.net/qq_36135928/article/details/78762521文章的启示。