001. shiro动态权限管理:

报以下异常:

Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'filterChainDefinitions' threw exception; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection

因为使用了shiro动态权限管理,所以重写了ShiroFilterFactoryBean中的方法,特别是setter方法,因为重写的setter方法中需要去数据中查询权限,但是连接数据库的url错误,导致无法连接数据库;

url错误: 本地mysql数据库的地址可以使用localhost或者127.0.0.1,但是不能使用本机的ip地址,如果连接其他电脑上的数据库可以使用ip地址;

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

推荐阅读更多精彩内容