分享一个shiro中遇到的小问题:没有k用户的问题

1.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring-mybatis.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:

PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'filterChainDefinitions' threw exception; nested exception is java.lang.IllegalArgumentException: Line argument must contain a key and a value.  Only one string token was found.

报这个错误是因为   ShiroFilterFactoryBean(shiro工厂类)的  fulterChainDefinitions这个属性中的配置必须是键值对形式的.

因为我使用了eclipse的自动格式化的快捷键导致    换行,所以才会出现这个错误 .

所以解决方法就是 检查一下是否是  键值对   且  必须在一行

2.

提示数据库没有K用户.

这个问题的原因是因为,spring在加载配置文件的时候,先加载的shiro的配置,后加载的mybatis,调整加载顺序就可以了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容