当前位置:网站首页>谷粒学苑P98踩坑 e.GlobalExceptionHandler : null
谷粒学苑P98踩坑 e.GlobalExceptionHandler : null
2022-07-25 23:15:00 【Cyclo-】
报错情况
2022-07-15 15:49:50.651 ERROR 10152 --- [nio-8001-exec-1] c.a.s.e.GlobalExceptionHandler : null
2022-07-15 15:49:50.654 ERROR 10152 --- [nio-8001-exec-1] c.a.s.e.GlobalExceptionHandler : GuliException(code=20002, msg=添加课程分类失败)
GuliException(code=20002, msg=添加课程分类失败)
at com.atguigu.eduservice.service.impl.EduSubjectServiceImpl.saveSubject(EduSubjectServiceImpl.java:38)
at com.atguigu.eduservice.service.impl.EduSubjectServiceImpl$$FastClassBySpringCGLIB$$e3ec89f4.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:685)
at com.atguigu.eduservice.service.impl.EduSubjectServiceImpl$$EnhancerBySpringCGLIB$$51228585.saveSubject(<generated>)
at com.atguigu.eduservice.controller.EduSubjectController.addSubject(EduSubjectController.java:39)
代码功能
实现读取本地excel,将数据上传到数据库
错误分析

上面的报错信息也是 从这里抛出的,但是我水平有限,无法分析出什么内容,所以尝试将原装的错误输出。
将上面的catch 修改
catch (Exception e){
e.printStackTrace();
}
就可以看到下面的报错
com.alibaba.excel.exception.ExcelAnalysisException:
### Error updating database. Cause: java.sql.SQLException: Field 'gmt_create' doesn't have a default value
### The error may involve com.atguigu.eduservice.mapper.EduSubjectMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO edu_subject ( id, title, parent_id ) VALUES ( ?, ?, ? )
### Cause: java.sql.SQLException: Field 'gmt_create' doesn't have a default value
; Field 'gmt_create' doesn't have a default value; nested exception is java.sql.SQLException: Field 'gmt_create' doesn't have a default value

修改bug
当修改或创建的时候都需要 给它们默认值,我们已经封装了自动赋值的handler
这里封装的自动填充类
边栏推荐
- firewall 命令简单操作
- How to obtain the cash flow data of advertising services to help analyze the advertising effect?
- [PTA] 7-24 minimum fraction (15 points)
- ZCMU--5015: 完成任务
- PHP binary array is sorted by a field in it
- r语言绘图参数(R语言plot画图)
- 推荐系统——An Embedding Learning Framework for Numerical Features in CTR Prediction
- Sichuan cuisine menu (I)
- ASP date function (what if the disk function is incorrect)
- Family relationship calculator wechat applet source code
猜你喜欢

5 ROS simulation modeling (3-rviz+gazebo+ control simulation robot)

Tips for using (1)

Custom MVC principle

Dynamic memory management

The fifth article in the series of radar Fundamentals: the function of radar modulation style

Very simple vsplayaudio online music player plug-in

Node基础

QT operation to solve large amount of duplicate data

内存分页与调优,内核与用户空间

连续三年成为云AI服务领导者,亚马逊云科技做对了什么?
随机推荐
Code shoe set precision barrage
r语言绘图参数(R语言plot画图)
[PTA] 7-19 check face value (15 points)
Several commonly used traversal methods
MathType安装和解决不能Crtl+V的问题
MathType installation and solution cannot solve the problem of crtl+v
新手哪个券商开户最好 开户最安全
Basic knowledge of radar
Enabling partners, how can Amazon cloud technology "get on the horse and get a ride"?
The fifth article in the series of radar Fundamentals: the function of radar modulation style
Single model common sense reasoning first surpasses human beings! HFL summit openbookqa challenge
2021-09-30
[paper notes] a meta reinforcement learning algorithm for causal discovery
Wechat official account, wechat payment development
Mongodb的特点、与MySQL的差别、以及应用场景
[opencv] edge detection [API and source code implementation]
类和对象(2)(6个默认成员函数)
Zcmu--5015: complete the task
四旋翼飞行器的飞控实现「建议收藏」
Network Security Learning notes-1 file upload