{ "message": "nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database. Cause: java.lang.reflect.InaccessibleObjectException: Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h accessible: module java.base does not \"opens java.lang.reflect\" to unnamed module @2118cddf\r\n### The error may exist in com/moxi/mogublog/xo/mapper/AdminMapper.java (best guess)\r\n### The error may involve com.moxi.mogublog.xo.mapper.AdminMapper.selectOne\r\n### The error occurred while handling results\r\n### SQL: SELECT uid,user_name,role_uid,pass_word,nick_name,gender,avatar,email,birthday,mobile,qq_number,we_chat,occupation,summary,person_resume,login_count,last_login_time,last_login_ip,github,gitee,status,create_time,update_time FROM t_admin WHERE user_name = ? AND status = ? LIMIT 1\r\n### Cause: java.lang.reflect.InaccessibleObjectException: Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h accessible: module java.base does not \"opens java.lang.reflect\" to unnamed module @2118cddf", "code": "error" }
时间: 2023-06-19 11:04:07 浏览: 102
这个错误信息是由于在执行 MyBatis 查询时出现了异常。异常的原因是由于程序无法访问 Java 反射中的受保护成员,具体原因是因为程序中访问了一个未命名模块,该模块并没有打开 Java 反射模块。
为了解决这个问题,需要检查程序中是否存在未命名模块,并且是否正确地打开了 Java 反射模块。还可以尝试升级程序中使用的 MyBatis 版本或者检查数据库的连接是否正确。
相关问题
MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database.
MyBatisSystemException是MyBatis框架中的一个异常类,它表示在执行数据库查询时发生了异常。其中,nested exception是指导致异常的具体原因,这里是org.apache.ibatis.exceptions.PersistenceException。
org.apache.ibatis.exceptions.PersistenceException是MyBatis框架中的另一个异常类,它表示在执行持久化操作时发生了异常。在这个异常中,错误查询数据库导致了异常的抛出。
这个异常通常发生在执行SQL语句时,可能是由于以下原因导致的:
1. 数据库连接问题:可能是数据库连接配置错误、数据库连接池问题或者数据库服务器不可用。
2. SQL语句错误:可能是SQL语句语法错误、表名或字段名错误等。
3. 数据库操作异常:可能是数据库表结构不匹配、数据类型不一致等。
为了解决这个问题,你可以尝试以下几个步骤:
1. 检查数据库连接配置是否正确,确保数据库服务器可用。
2. 检查SQL语句是否正确,包括表名、字段名、语法等。
3. 检查数据库表结构是否与代码中的映射一致,确保数据类型匹配。
4. 查看具体的异常信息,根据异常信息进一步排查问题。
mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database
根据提供的引用信息,出现了一个MyBatis与Spring整合的异常:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. 这个异常的原因是无法获取JDBC连接,可能是由于properties文件的错误配置或者命名冲突引起的。\[1\]\[2\]
为了解决这个问题,可以先检查properties文件的配置是否正确。确保数据库的用户名和密码正确,并且数据库连接的URL也正确。如果properties文件没有问题,那么可以继续检查是否存在命名冲突的问题。可能是在Controller控制层调用Service业务逻辑层时出现了错误。可以检查相关代码,确保调用的方法和参数正确。\[2\]\[3\]
如果以上方法都没有解决问题,可以尝试重新配置数据库连接池,确保可以成功获取JDBC连接。可以检查数据库连接池的配置是否正确,并且确保数据库的访问权限正确。如果仍然无法解决问题,可能需要进一步排查其他可能的原因,比如数据库服务器是否正常运行等。
#### 引用[.reference_title]
- *1* *2* [org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.Persiste](https://blog.csdn.net/weixin_48627356/article/details/122508771)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *3* [已解决org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflec](https://blog.csdn.net/weixin_50843918/article/details/129759776)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)