mybatis报Error updating database. Cause: java.lang.NullPointerException: temporal

mybatis报Error updating database. Cause: java.lang.NullPointerException: temporal,第1张

mybatis报Error updating database. Cause: java.lang.NullPointerException: temporal

@Error updating database. Cause: java.lang.NullPointerException: temporalTOC

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.lang.NullPointerException: temporal
### The error may involve
 xxxx.repo.mapper.xxxxxMapper.insertArch-Inline
### The error occurred while setting parameters

从报错看,可以确定是 xxxxxMapper.insertArch 这个类的这个方法执行时报错。

看这个方法,并没有什么问题。

@Insert({
xxxxxx
})
 int insertArch(TaskPpTxnQuery record);

百思不得其解,后来通过对抛出异常仔细看,看到下面有如下,DateTimeFormaater. 通过代码确认 ArchivableTask.getJobMd5,是对其他一个日期字段进行format后算MD5,但是刚好这条数据的日期字段是个非法日期。所以导致该错误

Caused by: java.lang.NullPointerException: temporal
        at java.util.Objects.requireNonNull(Objects.java:228)
        at java.time.format.DateTimeFormatter.formatTo(DateTimeFormatter.java:1741)
        at java.time.format.DateTimeFormatter.format(DateTimeFormatter.java:1720)
        xxxxxxxxxxxxxxx  ArchivableTask.getJobMd5(ArchivableTask.java:47)

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5687711.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-17
下一篇2022-12-17

发表评论

登录后才能评论

评论列表(0条)

    保存