m0_63924967
2022-06-29 12:53
采纳率: 50%
浏览 23
已结题

假性删除,不知道那里错了要怎么改

HTTP状态 500 - 内部服务器错误
类型 异常报告

消息 Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:

描述 服务器遇到一个意外的情况,阻止它完成请求。

例外情况

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: Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id))

The error may exist in file [D:\Homework\JavaEE--何庆新\submit homework\qimo选课\out\artifacts\aaaa_war_exploded\WEB-INF\classes\com\mybatisdao\ClazzMapper.xml]

The error may involve com.mybatisdao.ClazzMapper.clazzDel-Inline

The error occurred while setting parameters

SQL: delete from clazz where id = ?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id))

; Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (javaee.student, CONSTRAINT student_ibfk_1 FOREIGN KEY (clazzid) REFERENCES clazz (id))
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题