


Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@74a5df74] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@833048452 wrapping com.mysql.cj.jdbc.ConnectionImpl@76ba610e] will not be managed by Spring
==>  Preparing: SELECT id,username,password,real_name,email,phone,avatar,user_type,status,dept_id,last_login_time,create_time,update_time FROM user WHERE id=?
==> Parameters: 1(Long)
<==    Columns: id, username, password, real_name, email, phone, avatar, user_type, status, dept_id, last_login_time, create_time, update_time
<==        Row: 1, admin, $2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W, 系统管理员, admin@system.com, 13800000000, null, 1, 1, 1, null, 2026-04-16 09:05:15, 2026-05-10 19:08:59
<==      Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@74a5df74]
2026-06-10 13:44:38 - 请求 | URL: http://localhost:8080/api/exam/grade | 方法: POST | IP: 127.0.0.1
2026-06-10 13:44:38 - ========== 批阅接口请求开始 ==========
2026-06-10 13:44:38 - 请求完整内容: {"answer_type":"practice","answers":[{"max_score":10.0,"question_content":{"answer":"加强吸烟场所维护的主要目的是确保设施设备处于良好状态，保障文明吸烟环境功能作用的最大发挥，进一步提高消费者满意度。","data":{"scoring_points":[{"point":"要点1：确保设施设备良好状态","weight":0.5},{"point":"要点2：保障文明吸烟环境功能发挥","weight":0.3},{"point":"要点3：提高消费者满意度","weight":0.2}]},"stem":"请简述加强吸烟场所维护的主要目的及意义。"},"question_id":"806754e9-3951-4562-8641-553c42564ab8","question_type":"subjective","student_answer":"加强吸烟场所维护可以确保设施良好，提升吸烟环境，让消费者更满意。"}],"request_id":"test_005"}
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@503b434e] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@437070389 wrapping com.mysql.cj.jdbc.ConnectionImpl@76ba610e] will not be managed by Spring
==>  Preparing: SELECT id,username,password,real_name,email,phone,avatar,user_type,status,dept_id,last_login_time,create_time,update_time FROM user WHERE id=?
==> Parameters: 1(Long)
<==    Columns: id, username, password, real_name, email, phone, avatar, user_type, status, dept_id, last_login_time, create_time, update_time
<==        Row: 1, admin, $2a$10$o/mdlaGbhm7Fm0yrYFGICODFyqYUu/cd9Nj1xzc/qD9r3ukNZQr8W, 系统管理员, admin@system.com, 13800000000, null, 1, 1, 1, null, 2026-04-16 09:05:15, 2026-05-10 19:08:59
<==      Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@503b434e]
2026-06-10 13:44:38 - 当前用户ID: 1
2026-06-10 13:44:38 - 答案数量: 1
2026-06-10 13:44:38 - 日常练习/模拟考模式，开始验证答案数据...
2026-06-10 13:44:38 - 答案数据验证通过，共1个答案
2026-06-10 13:44:38 - 空试卷标记: isBlankSubmission=false
2026-06-10 13:44:38 - 自动生成试卷ID: paperId=68b2574e-e68b-486a-b86b-5426ab2e488b
2026-06-10 13:44:38 - 自动生成sessionId: grade_e099f4df
2026-06-10 13:44:38 - ========== 准备调用批阅服务 ==========
2026-06-10 13:44:38 - 批改答案请求参数汇总:
2026-06-10 13:44:38 -   - userId: 1
2026-06-10 13:44:38 -   - requestId: test_005
2026-06-10 13:44:38 -   - paperId: 68b2574e-e68b-486a-b86b-5426ab2e488b
2026-06-10 13:44:38 -   - sessionId: grade_e099f4df
2026-06-10 13:44:38 -   - answerType: practice
2026-06-10 13:44:38 -   - answers count: 1
2026-06-10 13:44:38 - Service层：开始批改题目
2026-06-10 13:44:38 - Service层参数详情:
2026-06-10 13:44:38 -   - userId: 1
2026-06-10 13:44:38 -   - paperId: 68b2574e-e68b-486a-b86b-5426ab2e488b
2026-06-10 13:44:38 -   - sessionId: grade_e099f4df
2026-06-10 13:44:38 -   - answerType: practice
2026-06-10 13:44:38 -   - 答案数量: 1
2026-06-10 13:44:38 -   - AI服务地址: http://localhost:5001/exam/grade
2026-06-10 13:44:38 - Service层：准备发送请求到AI服务
2026-06-10 13:44:38 - 请求体内容: {"request_id":"test_005","paper_id":"68b2574e-e68b-486a-b86b-5426ab2e488b","session_id":"grade_e099f4df","record_id":null,"answer_type":"practice","answers":[{"question_id":"806754e9-3951-4562-8641-553c42564ab8","question_type":"subjective","question_content":{"stem":"请简述加强吸烟场所维护的主要目的及意义。","data":{"scoring_points":[{"point":"要点1：确保设施设备良好状态","weight":0.5},{"point":"要点2：保障文明吸烟环境功能发挥","weight":0.3},{"point":"要点3：提高消费者满意度","weight":0.2}]},"answer":"加强吸烟场所维护的主要目的是确保设施设备处于良好状态，保障文明吸烟环境功能作用的最大发挥，进一步提高消费者满意度。"},"student_answer":"加强吸烟场所维护可以确保设施良好，提升吸烟环境，让消费者更满意。","max_score":10.0}]}
2026-06-10 13:44:38 - 请求超时时间: 60000ms (60秒)
2026-06-10 13:44:41 - Service层：收到AI服务响应
2026-06-10 13:44:41 - 响应原始内容: {"data":{"request_id":"test_005","results":[{"details":{"highlights":["\u5b66\u751f\u7b54\u6848\u7b80\u6d01\u660e\u4e86\uff0c\u80fd\u591f\u6293\u4f4f\u6838\u5fc3\u8981\u70b9\u3002","\u5bf9\u6d88\u8d39\u8005\u6ee1\u610f\u5ea6\u7684\u8868\u8ff0\u51c6\u786e\u3002"],"overall_feedback":"\u5b66\u751f\u7684\u7b54\u6848\u57fa\u672c\u7b26\u5408\u8981\u6c42\uff0c\u80fd\u591f\u6293\u4f4f\u4e3b\u8981\u89c2\u70b9\uff0c\u4f46\u5728\u90e8\u5206\u8981\u70b9\u7684\u8868\u8fbe\u4e0a\u7565\u663e\u7b80\u7565\uff0c\u5efa\u8bae\u8fdb\u4e00\u6b65\u5b8c\u5584\u8bed\u8a00\u8868\u8ff0\u4ee5\u63d0\u9ad8\u51c6\u786e\u6027\u3002","scoring_breakdown":[{"achieved":0.8,"comment":"\u5b66\u751f\u7b54\u6848\u63d0\u5230\u4e86'\u786e\u4fdd\u8bbe\u65bd\u826f\u597d'\uff0c\u4e0e\u8981\u70b9\u57fa\u672c\u4e00\u81f4\uff0c\u4f46\u672a\u660e\u786e\u63d0\u5230'\u8bbe\u65bd\u8bbe\u5907'\u7684\u5b8c\u6574\u8868\u8ff0\u3002","point":"\u8981\u70b91\uff1a\u786e\u4fdd\u8bbe\u65bd\u8bbe\u5907\u826f\u597d\u72b6\u6001","weight":0.5},{"achieved":0.6,"comment":"\u5b66\u751f\u7b54\u6848\u63d0\u5230'\u63d0\u5347\u5438\u70df\u73af\u5883'\uff0c\u4f46\u672a\u76f4\u63a5\u4f53\u73b0'\u4fdd\u969c\u6587\u660e\u5438\u70df\u73af\u5883\u529f\u80fd\u53d1\u6325'\u7684\u6838\u5fc3\u5185\u5bb9\u3002","point":"\u8981\u70b92\uff1a\u4fdd\u969c\u6587\u660e\u5438\u70df\u73af\u5883\u529f\u80fd\u53d1\u6325","weight":0.3},{"achieved":1.0,"comment":"\u5b66\u751f\u7b54\u6848\u660e\u786e\u63d0\u5230'\u8ba9\u6d88\u8d39\u8005\u66f4\u6ee1\u610f'\uff0c\u4e0e\u8981\u70b9\u5b8c\u5168\u4e00\u81f4\u3002","point":"\u8981\u70b93\uff1a\u63d0\u9ad8\u6d88\u8d39\u8005\u6ee1\u610f\u5ea6","weight":0.2}],"shortcomings":["\u672a\u660e\u786e\u63d0\u53ca'\u8bbe\u65bd\u8bbe\u5907'\u7684\u5b8c\u6574\u8868\u8ff0\u3002","\u5bf9'\u6587\u660e\u5438\u70df\u73af\u5883\u529f\u80fd\u53d1\u6325'\u7684\u7406\u89e3\u4e0d\u591f\u6df1\u5165\u3002"]},"max_score":10.0,"question_id":"806754e9-3951-4562-8641-553c42564ab8","score":8.0}],"score_rate":80.0,"success":true,"total_max_score":10.0,"total_score":8.0},"message":"\u6279\u9605\u5b8c\u6210","status":"success","status_code":2021,"success":true}

2026-06-10 13:44:41 - 开始解析 1 道题
2026-06-10 13:44:41 - 第 1 题 resultNode 内容: {"details":{"highlights":["学生答案简洁明了，能够抓住核心要点。","对消费者满意度的表述准确。"],"overall_feedback":"学生的答案基本符合要求，能够抓住主要观点，但在部分要点的表达上略显简略，建议进一步完善语言表述以提高准确性。","scoring_breakdown":[{"achieved":0.8,"comment":"学生答案提到了'确保设施良好'，与要点基本一致，但未明确提到'设施设备'的完整表述。","point":"要点1：确保设施设备良好状态","weight":0.5},{"achieved":0.6,"comment":"学生答案提到'提升吸烟环境'，但未直接体现'保障文明吸烟环境功能发挥'的核心内容。","point":"要点2：保障文明吸烟环境功能发挥","weight":0.3},{"achieved":1.0,"comment":"学生答案明确提到'让消费者更满意'，与要点完全一致。","point":"要点3：提高消费者满意度","weight":0.2}],"shortcomings":["未明确提及'设施设备'的完整表述。","对'文明吸烟环境功能发挥'的理解不够深入。"]},"max_score":10.0,"question_id":"806754e9-3951-4562-8641-553c42564ab8","score":8.0}
2026-06-10 13:44:41 - resultNode 字段: , 10.0, 806754e9-3951-4562-8641-553c42564ab8, 8.0
2026-06-10 13:44:41 - 读取到 question_id: 806754e9-3951-4562-8641-553c42564ab8
2026-06-10 13:44:41 - 已解析 details 结构
2026-06-10 13:44:41 - 从请求中补全 question_type: subjective
2026-06-10 13:44:41 - 处理第 1 题, 类型: subjective, grading_status: null
2026-06-10 13:44:41 - 检测到主观题，手动解析 details
2026-06-10 13:44:41 - 主观题 feedback 已设置，长度: 408
2026-06-10 13:44:41 - Service层：AI服务批改完成
2026-06-10 13:44:41 - 批改结果: success=true, totalScore=8.0, totalMaxScore=10.0, scoreRate=80.0
2026-06-10 13:44:41 - 各题目批改结果:
2026-06-10 13:44:41 -   题目1(806754e9-3951-4562-8641-553c42564ab8): correct=null, score=8.0/10.0, feedback=【亮点】
1. 学生答案简洁明了，能够抓住核心要点。
2. 对消费者满意度的表述准确。
【综合评价】
学生的答案基本符合要求，能够抓住主要观点，但在部分要点的表达上略显简略，建议进一步完善语言表述以提高准确性。
【评分详情】
- 要点1：确保设施设备良好状态 (权重: 50%, 得分率: 80%)
  评价: 学生答案提到了'确保设施良好'，与要点基本一致，但未明确提到'设施设备'的完整表述。
- 要点2：保障文明吸烟环境功能发挥 (权重: 30%, 得分率: 60%)
  评价: 学生答案提到'提升吸烟环境'，但未直接体现'保障文明吸烟环境功能发挥'的核心内容。
- 要点3：提高消费者满意度 (权重: 20%, 得分率: 100%)
  评价: 学生答案明确提到'让消费者更满意'，与要点完全一致。
【可改进之处】
1. 未明确提及'设施设备'的完整表述。
2. 对'文明吸烟环境功能发挥'的理解不够深入。
2026-06-10 13:44:41 - ========== 批阅成功 ==========
2026-06-10 13:44:41 - 批阅结果: totalScore=8.0, totalMaxScore=10.0, scoreRate=80.0%
2026-06-10 13:44:41 - 开始批量保存答题记录: count=1
Creating a new SqlSession
Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70586209]
JDBC Connection [HikariProxyConnection@305915904 wrapping com.mysql.cj.jdbc.ConnectionImpl@76ba610e] will be managed by Spring
==>  Preparing: SELECT id,user_id,question_id,question_type,answer_type,paper_id,session_id,user_answer,score,max_score,is_correct,grading_type,feedback,time_spent,paper_time_spent,created_at,updated_at FROM user_answer WHERE (user_id = ? AND question_id = ? AND paper_id = ? AND answer_type = ?)
==> Parameters: 1(Long), 806754e9-3951-4562-8641-553c42564ab8(String), 68b2574e-e68b-486a-b86b-5426ab2e488b(String), practice(String)
<==      Total: 0
Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70586209]
Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70586209] from current transaction
==>  Preparing: INSERT INTO user_answer ( user_id, question_id, question_type, answer_type, paper_id, session_id, user_answer, score, max_score, is_correct, grading_type, feedback, created_at, updated_at ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
==> Parameters: 1(Long), 806754e9-3951-4562-8641-553c42564ab8(String), subjective(String), practice(String), 68b2574e-e68b-486a-b86b-5426ab2e488b(String), grade_e099f4df(String), "加强吸烟场所维护可以确保设施良好，提升吸烟环境，让消费者更满意。"(String), 8.0(BigDecimal), 10.0(BigDecimal), 0(Integer), ai(String), 【亮点】
1. 学生答案简洁明了，能够抓住核心要点。
2. 对消费者满意度的表述准确。
【综合评价】
学生的答案基本符合要求，能够抓住主要观点，但在部分要点的表达上略显简略，建议进一步完善语言表述以提高准确性。
【评分详情】
- 要点1：确保设施设备良好状态 (权重: 50%, 得分率: 80%)
  评价: 学生答案提到了'确保设施良好'，与要点基本一致，但未明确提到'设施设备'的完整表述。
- 要点2：保障文明吸烟环境功能发挥 (权重: 30%, 得分率: 60%)
  评价: 学生答案提到'提升吸烟环境'，但未直接体现'保障文明吸烟环境功能发挥'的核心内容。
- 要点3：提高消费者满意度 (权重: 20%, 得分率: 100%)
  评价: 学生答案明确提到'让消费者更满意'，与要点完全一致。
【可改进之处】
1. 未明确提及'设施设备'的完整表述。
2. 对'文明吸烟环境功能发挥'的理解不够深入。(String), 2026-06-10T13:44:41.140192733(LocalDateTime), 2026-06-10T13:44:41.140943974(LocalDateTime)
Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70586209]
Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70586209]
Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70586209]
2026-06-10 13:44:41 - ========== 批改答案发生未知异常 ==========
2026-06-10 13:44:41 - 错误类型: org.springframework.dao.DataIntegrityViolationException
2026-06-10 13:44:41 - 错误信息: 
### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`knowledge_management_system`.`user_answer`, CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT)
### The error may exist in top/tqx/demo_1/mapper/UserAnswerMapper.java (best guess)
### The error may involve top.tqx.demo_1.mapper.UserAnswerMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO user_answer  ( user_id, question_id, question_type, answer_type, paper_id, session_id, user_answer, score, max_score, is_correct, grading_type, feedback,   created_at, updated_at )  VALUES (  ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,   ?, ?  )
### Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`knowledge_management_system`.`user_answer`, CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT)
; Cannot add or update a child row: a foreign key constraint fails (`knowledge_management_system`.`user_answer`, CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT)
2026-06-10 13:44:41 - 可能的错误位置:
2026-06-10 13:44:41 -   at top.tqx.demo_1.service.impl.UserAnswerServiceImpl.batchSaveAnswers:UserAnswerServiceImpl.java (行号: 98)
2026-06-10 13:44:41 -   at top.tqx.demo_1.service.impl.UserAnswerServiceImpl$$SpringCGLIB$$0.batchSaveAnswers:<generated> (行号: -1)
2026-06-10 13:44:41 -   at top.tqx.demo_1.controller.ExamController.saveUserAnswers:ExamController.java (行号: 583)
2026-06-10 13:44:41 -   at top.tqx.demo_1.controller.ExamController.gradeAnswers:ExamController.java (行号: 416)
2026-06-10 13:44:41 -   at top.tqx.demo_1.aspect.LogAspect.around:LogAspect.java (行号: 43)
2026-06-10 13:44:41 -   at top.tqx.demo_1.controller.ExamController$$SpringCGLIB$$0.gradeAnswers:<generated> (行号: -1)
2026-06-10 13:44:41 - 完整堆栈: 
org.springframework.dao.DataIntegrityViolationException: 
### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`knowledge_management_system`.`user_answer`, CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT)
### The error may exist in top/tqx/demo_1/mapper/UserAnswerMapper.java (best guess)
### The error may involve top.tqx.demo_1.mapper.UserAnswerMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO user_answer  ( user_id, question_id, question_type, answer_type, paper_id, session_id, user_answer, score, max_score, is_correct, grading_type, feedback,   created_at, updated_at )  VALUES (  ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,   ?, ?  )
### Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`knowledge_management_system`.`user_answer`, CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT)
; Cannot add or update a child row: a foreign key constraint fails (`knowledge_management_system`.`user_answer`, CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT)
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:258)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:107)
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)
	at jdk.proxy2/jdk.proxy2.$Proxy87.insert(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)
	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59)
	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152)
	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
	at jdk.proxy2/jdk.proxy2.$Proxy107.insert(Unknown Source)
	at top.tqx.demo_1.service.impl.UserAnswerServiceImpl.batchSaveAnswers(UserAnswerServiceImpl.java:98)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:392)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
	at top.tqx.demo_1.service.impl.UserAnswerServiceImpl$$SpringCGLIB$$0.batchSaveAnswers(<generated>)
	at top.tqx.demo_1.controller.ExamController.saveUserAnswers(ExamController.java:583)
	at top.tqx.demo_1.controller.ExamController.gradeAnswers(ExamController.java:416)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
	at top.tqx.demo_1.aspect.LogAspect.around(LogAspect.java:43)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
	at top.tqx.demo_1.controller.ExamController$$SpringCGLIB$$0.gradeAnswers(<generated>)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`knowledge_management_system`.`user_answer`, CONSTRAINT `fk_user_answer_question` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE CASCADE ON UPDATE RESTRICT)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:118)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:912)
	at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
	at jdk.internal.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58)
	at jdk.proxy3/jdk.proxy3.$Proxy163.execute(Unknown Source)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
	at jdk.proxy2/jdk.proxy2.$Proxy161.update(Unknown Source)
	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
	at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106)
	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59)
	at jdk.proxy2/jdk.proxy2.$Proxy160.update(Unknown Source)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425)
	... 102 common frames omitted
2026-06-10 13:44:41 - 响应 | 耗时: 2889ms
