org.apache.ibatis.exceptions.PersistenceException: NullPointerException
时间: 2023-10-17 19:36:23 浏览: 132
NullPointerException 异常处理
org.apache.ibatis.exceptions.PersistenceException: NullPointerException是Mybatis中的一个错误。它表示在查询数据库时出现了空指针异常。
解决这个问题有两种方法。一种是在Mybatis的配置文件中添加typeAliases,另一种是在mapper.xml文件中的resultMap的Type中指定实体类的包名。这两种方法都可以解决这个问题,但推荐使用第二种方法。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [错误排查:Caused by: org.apache.ibatis.exceptions.PersistenceException](https://blog.csdn.net/JavaBuilt/article/details/111169943)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法](https://download.csdn.net/download/weixin_38500709/13701351)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [org.apache.ibatis.exceptions.PersistenceException:解决方法](https://blog.csdn.net/jyxmust/article/details/55096762)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文