尚学堂给同学们带来全新的Java300集课程啦!java零基础小白自学Java必备优质教程_手把手图解学习Java,让学习成为一种享受_哔哩哔哩_bilibili
报以下异常:
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地址;
本文介绍了一个关于Java应用中使用Shiro进行权限管理时出现的问题:由于数据库连接URL配置错误导致的ShiroFilterFactoryBean设置方法异常。具体表现为在重写ShiroFilterFactoryBean的setter方法时未能正确配置数据库连接,导致无法获取权限信息。
1万+

被折叠的 条评论
为什么被折叠?



