javax.persistence.PersistenceException

ERROR executing DML bindLog[] error[CONSTRAINT 'ck_n4user_state' failed for 'yona'.'n4user']

Samebug tips1

It was a database inconsistency issue in the integration test dataset.


poroszdporoszd

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web26

Stack trace

  • javax.persistence.PersistenceException: ERROR executing DML bindLog[] error[CONSTRAINT 'ck_n4user_state' failed for 'yona'.'n4user'] at com.avaje.ebeaninternal.server.persist.dml.DmlBeanPersister.execute(DmlBeanPersister.java:97) at com.avaje.ebeaninternal.server.persist.dml.DmlBeanPersister.insert(DmlBeanPersister.java:57) at com.avaje.ebeaninternal.server.persist.DefaultPersistExecute.executeInsertBean(DefaultPersistExecute.java:66) at com.avaje.ebeaninternal.server.core.PersistRequestBean.executeNow(PersistRequestBean.java:448) at com.avaje.ebeaninternal.server.core.PersistRequestBean.executeOrQueue(PersistRequestBean.java:478) at com.avaje.ebeaninternal.server.persist.DefaultPersister.insert(DefaultPersister.java:331) at com.avaje.ebeaninternal.server.persist.DefaultPersister.saveEnhanced(DefaultPersister.java:306) at com.avaje.ebeaninternal.server.persist.DefaultPersister.saveRecurse(DefaultPersister.java:276) at com.avaje.ebeaninternal.server.persist.DefaultPersister.save(DefaultPersister.java:244) at com.avaje.ebeaninternal.server.core.DefaultServer.save(DefaultServer.java:1801) at com.avaje.ebeaninternal.server.core.DefaultServer.save(DefaultServer.java:1779) at com.avaje.ebean.Ebean.save(Ebean.java:526) at com.avaje.ebean.Ebean.save(Ebean.java:533) at utils.YamlUtil.insertDataFromYaml(YamlUtil.java:45) at Global.insertInitialData(Global.java:161) at Global.onStart(Global.java:139) at play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:22) at play.api.GlobalPlugin.onStart(GlobalSettings.scala:220) at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91) at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91) at scala.collection.immutable.List.foreach(List.scala:318) at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91) at play.api.Play$$anonfun$start$1.apply(Play.scala:91) at play.api.Play$$anonfun$start$1.apply(Play.scala:91) at play.utils.Threads$.withContextClassLoader(Threads.scala:21) at play.api.Play$.start(Play.scala:90) at play.core.StaticApplication.<init>(ApplicationProvider.scala:55) at play.core.server.NettyServer$.createServer(NettyServer.scala:253) at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:289) at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:284) at scala.Option.map(Option.scala:145) at play.core.server.NettyServer$.main(NettyServer.scala:284) at play.core.server.NettyServer.main(NettyServer.scala) Caused by: java.sql.BatchUpdateException: CONSTRAINT 'ck_n4user_state' failed for 'yona'.'n4user' at org.mariadb.jdbc.MariaDbServerPreparedStatement.execute(MariaDbServerPreparedStatement.java:374) at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeUpdate(MariaDbServerPreparedStatement.java:347) at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:205) at com.avaje.ebeaninternal.server.type.DataBind.executeUpdate(DataBind.java:55) at com.avaje.ebeaninternal.server.persist.dml.InsertHandler.execute(InsertHandler.java:134) at com.avaje.ebeaninternal.server.persist.dml.DmlBeanPersister.execute(DmlBeanPersister.java:86) ... 32 more Caused by: java.sql.SQLIntegrityConstraintViolationException: CONSTRAINT 'ck_n4user_state' failed for 'yona'.'n4user' at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:119) at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:69) at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeQueryEpilog(MariaDbServerPreparedStatement.java:336) at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:291) at org.mariadb.jdbc.MariaDbServerPreparedStatement.execute(MariaDbServerPreparedStatement.java:369) ... 37 more Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: CONSTRAINT 'ck_n4user_state' failed for 'yona'.'n4user' at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:479) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executePreparedQuery(AbstractQueryProtocol.java:592) at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:279) ... 38 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

rprp
2 times, last one
aldrinlealaldrinleal
2 times, last one
olle.hallinolle.hallin
6 times, last one
derproggerderprogger
Once,
poroszdporoszd
4 times, last one
1 more bugmates