Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,

    Check whether privilege has the "not null" restriction. If so it always has to have a value and can never be null.

    A different reason could be a wrong implementation of a foreign key. Check whether you always correctly insert/update in both tables.

  2. ,

    Nothing is wrong with the database. When it gives you those errors, it's telling you that you are trying to input "nothing" (null) into a column that doesn't allow it. Fix it by removing the not null constraint or by passing a value to that field.

Solutions on the web

via Google Groups by Jeffrey Wong, 1 year ago
Cannot add or update a child row: a foreign key constraint fails (`cas`.`SERVICETICKET`, CONSTRAINT `FK(TGTID)` FOREIG > > N KEY (`ticketGrantingTicket_ID`) REFERENCES `TICKETGRANTINGTICKET` (`ID`))
via GitHub by matthewlenz
, 2 years ago
Duplicate entry '2464' for key 'PRIMARY'
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails 
(`cas`.`SERVICETICKET`, CONSTRAINT `FK(TGTID)` FOREIG
N KEY (`ticketGrantingTicket_ID`) REFERENCES `TICKETGRANTINGTICKET` (`ID`))	at sun.reflect.GeneratedConstructorAccessor131.newInstance(Unknown Source)	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)	at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)	at com.mysql.jdbc.Util.getInstance(Util.java:387)	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:932)	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478)	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625)	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2551)	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)	at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1751)	at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1257)	at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:959)	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:2544)	at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110)	at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:97)	at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:147)	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:214)	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:470)