用户登录报200,用户注册报500
来源:6-9 用户模块所有功能自测试
慕UI937661
2019-02-18
用户登录:
{
“status”: 1,
“msg”: “用户名不存在”
}
用户注册时:
<!doctype html>
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:
Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘username’ cannot be null
The error may involve com.mmall.dao.UserMapper.insert-Inline
The error occurred while setting parameters
SQL: insert into mmall_user (id, username, password, email, phone, question, answer, role, create_time, update_time) values (?, ?, ?, ?, ?, ?, ?, ?, now(), now())
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘username’ cannot be null
; SQL []; Column ‘username’ cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘username’ cannot be null
写回答
1回答
-
geelylucky
2019-02-18
亲爱的同学,你好,我是geely老师的助教。
错误信息很明显哦,你给的username是一个null,导致无法插入数据哦。
042019-02-19
相似问题