org.hibernate.exception.ConstraintViolationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Using org.hibernate.dialect.MySQL5InnoDBDialect in persistence.xml and referenced entities causes integration tests to fail because of foreign key constraint violation. The following exception is an example: SQL Error: 1451, SQLState: 23000 Cannot delete or update a parent row: a foreign key constraint fails (`fit_reporting`.`abstract_person`, CONSTRAINT `FKD0E39E12586E161C` FOREIGN KEY ( `country`) REFERENCES `abstract_system_key` (`id`)) Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: could not delete: [de.fittransporte.fitdb.reference.Country#10] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2546) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2702) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:77) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:81) at de.fittransporte.fitdb.reference.DefectCauser_Roo_Entity.ajc$interMethod$de_fittransporte_fitdb_reference_DefectCauser_Roo_Entity$de_fittransporte_fitdb_reference_DefectCauser$countDefectCausers(DefectCauser_Roo_Entity.aj:8) at de.fittransporte.fitdb.reference.DefectCauser.countDefectCausers(DefectCauser.java:1) at de.fittransporte.fitdb.reference.DefectCauser_Roo_Entity.ajc$interMethodDispatch1$de_fittransporte_fitdb_reference_DefectCauser_Roo_Entity$de_fittransporte_fitdb_reference_DefectCauser$countDefectCausers(DefectCauser_Roo_Entity.aj) at de.fittransporte.fitdb.reference.DefectCauserIntegrationTest_Roo_IntegrationTest.ajc$interMethod$de_fittransporte_fitdb_reference_DefectCauserIntegrationTest_Roo_IntegrationTest$de_fittransporte_fitdb_reference_DefectCauserIntegrationTest$testFindDefectCauserEntries(DefectCauserIntegrationTest_Roo_IntegrationTest.aj:42) at de.fittransporte.fitdb.reference.DefectCauserIntegrationTest.testFindDefectCauserEntries(DefectCauserIntegrationTest.java:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunSpringTestContextBefores.evaluate(RunSpringTestContextBefores.java:74) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.springframework.test.context.junit4.statements.RunSpringTestContextAfters.evaluate(RunSpringTestContextAfters.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:210) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`fit_reporting`.`abstract_person`, CONSTRAINT `FKD0E39E12586E161C` FOREIGN KEY (`country`) REFERENCES `abstract_system_key` (`id`)) at sun.reflect.GeneratedConstructorAccessor64.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2528) ... 48 more Tests run: 12, Failures: 4, Errors: 7, Skipped: 0, Time elapsed: 1.625 sec <<< FAILURE! persistence.xml: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/fit_reporting?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;connectionCollation=utf8_general_ci&amp;characterSetResults=utf8" /> </properties> </persistence-unit> </persistence> example_script.roo: // the following is an excerpt of the whole script I ran before the above error but it should help to reproduce the problem create project -topLevelPackage de.fittransporte.fitdb install jpa -provider HIBERNATE -database MYSQL new persistent class jpa -name ~.reference.AbstractSystemKey -abstract new persistent class jpa -name ~.reference.Country -extends ~.reference.AbstractSystemKey -testAutomatically new persistent class jpa -name ~.domain.Customer -testAutomatically add field string -class ~.reference.AbstractSystemKey -fieldName name -notNull -sizeMax 30 add field string -class ~.reference.AbstractSystemKey -fieldName tooltip -sizeMax 255 add field number -class ~.reference.AbstractSystemKey -fieldName ordering -type java.lang.Integer -min 1 add field string -class ~.domain.Customer -fieldName description -notNull -sizeMax 30 add field string -class ~.domain.Customer -fieldName street -notNull -sizeMin 2 -sizeMax 50 add field string -class ~.domain.Customer -fieldName houseNumber -notNull -sizeMin 1 -sizeMax 10 add field string -class ~.domain.Customer -fieldName postalCode -notNull -sizeMin 5 -sizeMax 10 add field string -class ~.domain.Customer -fieldName city -notNull -sizeMax 30 add field reference jpa -class ~.domain.Customer -fieldName country -type ~.reference.Country new integration test new controller automatic -name ~.web.CountryController -formBackingObject ~.reference.Country new controller automatic -name ~.web.CustomerController -formBackingObject ~.domain.Customer new selenium test -controller ~.web.CountryController new selenium test -controller ~.web.CustomerController // replace generated "persistence.xml" with the one given above // execute "mvn test" Current workaround is to run e.g. "mvn package" with the switch "-Dmaven.test.skip=true". Greets, Alex
    via by Alexander Heusingfeld,
  • Using org.hibernate.dialect.MySQL5InnoDBDialect in persistence.xml and referenced entities causes integration tests to fail because of foreign key constraint violation. The following exception is an example: SQL Error: 1451, SQLState: 23000 Cannot delete or update a parent row: a foreign key constraint fails (`fit_reporting`.`abstract_person`, CONSTRAINT `FKD0E39E12586E161C` FOREIGN KEY ( `country`) REFERENCES `abstract_system_key` (`id`)) Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: could not delete: [de.fittransporte.fitdb.reference.Country#10] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2546) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2702) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:77) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:81) at de.fittransporte.fitdb.reference.DefectCauser_Roo_Entity.ajc$interMethod$de_fittransporte_fitdb_reference_DefectCauser_Roo_Entity$de_fittransporte_fitdb_reference_DefectCauser$countDefectCausers(DefectCauser_Roo_Entity.aj:8) at de.fittransporte.fitdb.reference.DefectCauser.countDefectCausers(DefectCauser.java:1) at de.fittransporte.fitdb.reference.DefectCauser_Roo_Entity.ajc$interMethodDispatch1$de_fittransporte_fitdb_reference_DefectCauser_Roo_Entity$de_fittransporte_fitdb_reference_DefectCauser$countDefectCausers(DefectCauser_Roo_Entity.aj) at de.fittransporte.fitdb.reference.DefectCauserIntegrationTest_Roo_IntegrationTest.ajc$interMethod$de_fittransporte_fitdb_reference_DefectCauserIntegrationTest_Roo_IntegrationTest$de_fittransporte_fitdb_reference_DefectCauserIntegrationTest$testFindDefectCauserEntries(DefectCauserIntegrationTest_Roo_IntegrationTest.aj:42) at de.fittransporte.fitdb.reference.DefectCauserIntegrationTest.testFindDefectCauserEntries(DefectCauserIntegrationTest.java:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunSpringTestContextBefores.evaluate(RunSpringTestContextBefores.java:74) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.springframework.test.context.junit4.statements.RunSpringTestContextAfters.evaluate(RunSpringTestContextAfters.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:210) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`fit_reporting`.`abstract_person`, CONSTRAINT `FKD0E39E12586E161C` FOREIGN KEY (`country`) REFERENCES `abstract_system_key` (`id`)) at sun.reflect.GeneratedConstructorAccessor64.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2528) ... 48 more Tests run: 12, Failures: 4, Errors: 7, Skipped: 0, Time elapsed: 1.625 sec <<< FAILURE! persistence.xml: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/fit_reporting?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;connectionCollation=utf8_general_ci&amp;characterSetResults=utf8" /> </properties> </persistence-unit> </persistence> example_script.roo: // the following is an excerpt of the whole script I ran before the above error but it should help to reproduce the problem create project -topLevelPackage de.fittransporte.fitdb install jpa -provider HIBERNATE -database MYSQL new persistent class jpa -name ~.reference.AbstractSystemKey -abstract new persistent class jpa -name ~.reference.Country -extends ~.reference.AbstractSystemKey -testAutomatically new persistent class jpa -name ~.domain.Customer -testAutomatically add field string -class ~.reference.AbstractSystemKey -fieldName name -notNull -sizeMax 30 add field string -class ~.reference.AbstractSystemKey -fieldName tooltip -sizeMax 255 add field number -class ~.reference.AbstractSystemKey -fieldName ordering -type java.lang.Integer -min 1 add field string -class ~.domain.Customer -fieldName description -notNull -sizeMax 30 add field string -class ~.domain.Customer -fieldName street -notNull -sizeMin 2 -sizeMax 50 add field string -class ~.domain.Customer -fieldName houseNumber -notNull -sizeMin 1 -sizeMax 10 add field string -class ~.domain.Customer -fieldName postalCode -notNull -sizeMin 5 -sizeMax 10 add field string -class ~.domain.Customer -fieldName city -notNull -sizeMax 30 add field reference jpa -class ~.domain.Customer -fieldName country -type ~.reference.Country new integration test new controller automatic -name ~.web.CountryController -formBackingObject ~.reference.Country new controller automatic -name ~.web.CustomerController -formBackingObject ~.domain.Customer new selenium test -controller ~.web.CountryController new selenium test -controller ~.web.CustomerController // replace generated "persistence.xml" with the one given above // execute "mvn test" Current workaround is to run e.g. "mvn package" with the switch "-Dmaven.test.skip=true". Greets, Alex
    via by Alexander Heusingfeld,
  • Simple But Crazy Cascade Problem
    via by Gokcen Guner,
  • GitHub comment 7#8812055
    via GitHub by simplechen
    ,
  • 为什么会出现乱码?
    via GitHub by xiegengcai
    ,
    • org.hibernate.exception.ConstraintViolationException: could not delete: [de.fittransporte.fitdb.reference.Country#10] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2546) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2702) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:77) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:81) at de.fittransporte.fitdb.reference.DefectCauser_Roo_Entity.ajc$interMethod$de_fittransporte_fitdb_reference_DefectCauser_Roo_Entity$de_fittransporte_fitdb_reference_DefectCauser$countDefectCausers(DefectCauser_Roo_Entity.aj:8) at de.fittransporte.fitdb.reference.DefectCauser.countDefectCausers(DefectCauser.java:1) at de.fittransporte.fitdb.reference.DefectCauser_Roo_Entity.ajc$interMethodDispatch1$de_fittransporte_fitdb_reference_DefectCauser_Roo_Entity$de_fittransporte_fitdb_reference_DefectCauser$countDefectCausers(DefectCauser_Roo_Entity.aj) at de.fittransporte.fitdb.reference.DefectCauserIntegrationTest_Roo_IntegrationTest.ajc$interMethod$de_fittransporte_fitdb_reference_DefectCauserIntegrationTest_Roo_IntegrationTest$de_fittransporte_fitdb_reference_DefectCauserIntegrationTest$testFindDefectCauserEntries(DefectCauserIntegrationTest_Roo_IntegrationTest.aj:42) at de.fittransporte.fitdb.reference.DefectCauserIntegrationTest.testFindDefectCauserEntries(DefectCauserIntegrationTest.java:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunSpringTestContextBefores.evaluate(RunSpringTestContextBefores.java:74) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.springframework.test.context.junit4.statements.RunSpringTestContextAfters.evaluate(RunSpringTestContextAfters.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:210) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`fit_reporting`.`abstract_person`, CONSTRAINT `FKD0E39E12586E161C` FOREIGN KEY (`country`) REFERENCES `abstract_system_key` (`id`)) at sun.reflect.GeneratedConstructorAccessor64.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2528) ... 48 more

    Users with the same issue

    Михайло ТітовМихайло Тітов
    2 times, last one,
    slashslash
    1 times, last one,
    ivanszkypeterivanszkypeter
    8 times, last one,
    DoktorDoener666DoktorDoener666
    2 times, last one,
    mauritiusmauritius
    1 times, last one,
    60 more bugmates