org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]

Spring JIRA | Bruce Edge | 5 years ago
  1. 0

    For any project I create with roo, no matter how small, running on STS's embedded tcServer Developer edition 2.5 generates the following stack trace on startup: Sep 16, 2011 4:01:36 PM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath INFO: file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.0.RELEASE.jar: aspects will be woven into the main Tomcat classloader Sep 16, 2011 4:01:36 PM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath INFO: file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.0.RELEASE.jar: aspects will be woven into the main Tomcat classloader Sep 16, 2011 4:01:36 PM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath INFO: file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-tomcat-1.5.0.RELEASE.jar: aspects will be woven into the main Tomcat classloader ASPECTJ: aspectj.overweaving=true: overweaving switched ON Sep 16, 2011 4:01:37 PM com.springsource.tcserver.security.PropertyDecoder <init> INFO: tc Runtime property decoder using memory-based key Sep 16, 2011 4:01:37 PM com.springsource.tcserver.security.PropertyDecoder <init> INFO: tcServer Runtime property decoder has been initialized in 208 ms Sep 16, 2011 4:01:38 PM org.apache.coyote.AbstractProtocolHandler init INFO: Initializing ProtocolHandler ["http-bio-8080"] Sep 16, 2011 4:01:38 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init INFO: Started up JMX registry on 127.0.0.1:6969 in 69 ms Sep 16, 2011 4:01:38 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 908 ms Sep 16, 2011 4:01:38 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Sep 16, 2011 4:01:38 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: SpringSource tc Runtime 2.5.0.RELEASE/7.0.12.A.RELEASE Sep 16, 2011 4:01:38 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor foomvc.xml from /Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/conf/Catalina/localhost Sep 16, 2011 4:01:38 PM org.apache.catalina.startup.SetContextPropertiesRule begin WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:foomvc' did not find a matching property. [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.0.RELEASE.jar!/META-INF/aop.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.0.RELEASE.jar!/META-INF/aop.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-tomcat-1.5.0.RELEASE.jar!/META-INF/aop-ajc.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.0.RELEASE.jar!/META-INF/aop-ajc.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.0.RELEASE.jar!/META-INF/aop-ajc.xml ASPECTJ: aspectj.overweaving=true: overweaving switched ON Sep 16, 2011 4:01:39 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext [TomcatWeavingInsightClassLoader@11c0b8a0] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified Sep 16, 2011 4:01:47 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'foomvc' Sep 16, 2011 4:01:48 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor insight.xml from /Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/conf/Catalina/localhost Sep 16, 2011 4:01:48 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start INFO: Context [localhost|insight] will not be woven Sep 16, 2011 4:01:48 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext Sep 16, 2011 4:01:58 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet' Sep 16, 2011 4:01:59 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory manager Sep 16, 2011 4:01:59 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory ROOT Sep 16, 2011 4:01:59 PM org.apache.coyote.AbstractProtocolHandler start INFO: Starting ProtocolHandler ["http-bio-8080"] Sep 16, 2011 4:01:59 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 21857 ms Exception in thread "purgeThread" org.springframework.dao.DataIntegrityViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]; SQL [delete from resources where id=? and version=?]; constraint ["FK_RESOURCES_APPLICATION: PUBLIC.RESOURCES FOREIGN KEY(APPLICATION) REFERENCES PUBLIC.RESOURCES(ID)"; SQL statement: delete from resources where id=? and version=? [23003-147]]; nested exception is org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:102) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:368) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy68.findResource(Unknown Source) at com.springsource.insight.repo.resource.persist.PersistedResourceRepo.removeResource(PersistedResourceRepo.java:175) at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy71.removeResource(Unknown Source) at com.springsource.insight.repo.purge.IncrementalPurgerImpl.purgeResources(IncrementalPurgerImpl.java:86) 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy78.purgeResources(Unknown Source) at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeResources(PurgeServiceImpl.java:145) at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeData(PurgeServiceImpl.java:121) at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeExpiredData(PurgeServiceImpl.java:87) at com.springsource.insight.repo.purge.PurgeServiceImpl$2.run(PurgeServiceImpl.java:177) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2710) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2893) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:189) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1261) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:274) at com.springsource.insight.repo.resource.persist.JpaResourceDAO.getResource(JpaResourceDAO.java:74) at com.springsource.insight.repo.resource.persist.JpaResourceDAO.findResource(JpaResourceDAO.java:63) at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) ... 35 more Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "FK_RESOURCES_APPLICATION: PUBLIC.RESOURCES FOREIGN KEY(APPLICATION) REFERENCES PUBLIC.RESOURCES(ID)"; SQL statement: delete from resources where id=? and version=? [23003-147] at org.h2.message.DbException.getJdbcSQLException(DbException.java:327) at org.h2.message.DbException.get(DbException.java:167) at org.h2.message.DbException.get(DbException.java:144) at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:382) at org.h2.constraint.ConstraintReferential.checkRowRefTable(ConstraintReferential.java:399) at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:275) at org.h2.table.Table.fireConstraints(Table.java:812) at org.h2.table.Table.fireAfterRow(Table.java:829) at org.h2.command.dml.Delete.update(Delete.java:80) at org.h2.command.CommandContainer.update(CommandContainer.java:69) at org.h2.command.Command.executeUpdate(Command.java:201) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143) at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2692) ... 55 more The app works, but this is disconcerting and I'm assuming someone should be aware of this. Attached roo script to create the simple test case project. (using roo 1.2.M1)

    Spring JIRA | 5 years ago | Bruce Edge
    org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]
  2. 0

    For any project I create with roo, no matter how small, running on STS's embedded tcServer Developer edition 2.5 generates the following stack trace on startup: Sep 16, 2011 4:01:36 PM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath INFO: file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.0.RELEASE.jar: aspects will be woven into the main Tomcat classloader Sep 16, 2011 4:01:36 PM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath INFO: file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.0.RELEASE.jar: aspects will be woven into the main Tomcat classloader Sep 16, 2011 4:01:36 PM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath INFO: file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-tomcat-1.5.0.RELEASE.jar: aspects will be woven into the main Tomcat classloader ASPECTJ: aspectj.overweaving=true: overweaving switched ON Sep 16, 2011 4:01:37 PM com.springsource.tcserver.security.PropertyDecoder <init> INFO: tc Runtime property decoder using memory-based key Sep 16, 2011 4:01:37 PM com.springsource.tcserver.security.PropertyDecoder <init> INFO: tcServer Runtime property decoder has been initialized in 208 ms Sep 16, 2011 4:01:38 PM org.apache.coyote.AbstractProtocolHandler init INFO: Initializing ProtocolHandler ["http-bio-8080"] Sep 16, 2011 4:01:38 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init INFO: Started up JMX registry on 127.0.0.1:6969 in 69 ms Sep 16, 2011 4:01:38 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 908 ms Sep 16, 2011 4:01:38 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Sep 16, 2011 4:01:38 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: SpringSource tc Runtime 2.5.0.RELEASE/7.0.12.A.RELEASE Sep 16, 2011 4:01:38 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor foomvc.xml from /Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/conf/Catalina/localhost Sep 16, 2011 4:01:38 PM org.apache.catalina.startup.SetContextPropertiesRule begin WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:foomvc' did not find a matching property. [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.0.RELEASE.jar!/META-INF/aop.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.0.RELEASE.jar!/META-INF/aop.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-tomcat-1.5.0.RELEASE.jar!/META-INF/aop-ajc.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.0.RELEASE.jar!/META-INF/aop-ajc.xml [TomcatWeavingInsightClassLoader@11c0b8a0] warning ignoring duplicate definition: jar:file:/Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.0.RELEASE.jar!/META-INF/aop-ajc.xml ASPECTJ: aspectj.overweaving=true: overweaving switched ON Sep 16, 2011 4:01:39 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext [TomcatWeavingInsightClassLoader@11c0b8a0] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified Sep 16, 2011 4:01:47 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'foomvc' Sep 16, 2011 4:01:48 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor insight.xml from /Users/bedge/local/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/conf/Catalina/localhost Sep 16, 2011 4:01:48 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start INFO: Context [localhost|insight] will not be woven Sep 16, 2011 4:01:48 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext Sep 16, 2011 4:01:58 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet' Sep 16, 2011 4:01:59 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory manager Sep 16, 2011 4:01:59 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory ROOT Sep 16, 2011 4:01:59 PM org.apache.coyote.AbstractProtocolHandler start INFO: Starting ProtocolHandler ["http-bio-8080"] Sep 16, 2011 4:01:59 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 21857 ms Exception in thread "purgeThread" org.springframework.dao.DataIntegrityViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]; SQL [delete from resources where id=? and version=?]; constraint ["FK_RESOURCES_APPLICATION: PUBLIC.RESOURCES FOREIGN KEY(APPLICATION) REFERENCES PUBLIC.RESOURCES(ID)"; SQL statement: delete from resources where id=? and version=? [23003-147]]; nested exception is org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:102) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:368) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy68.findResource(Unknown Source) at com.springsource.insight.repo.resource.persist.PersistedResourceRepo.removeResource(PersistedResourceRepo.java:175) at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy71.removeResource(Unknown Source) at com.springsource.insight.repo.purge.IncrementalPurgerImpl.purgeResources(IncrementalPurgerImpl.java:86) 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy78.purgeResources(Unknown Source) at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeResources(PurgeServiceImpl.java:145) at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeData(PurgeServiceImpl.java:121) at com.springsource.insight.repo.purge.PurgeServiceImpl.purgeExpiredData(PurgeServiceImpl.java:87) at com.springsource.insight.repo.purge.PurgeServiceImpl$2.run(PurgeServiceImpl.java:177) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2710) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2893) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:189) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1261) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:274) at com.springsource.insight.repo.resource.persist.JpaResourceDAO.getResource(JpaResourceDAO.java:74) at com.springsource.insight.repo.resource.persist.JpaResourceDAO.findResource(JpaResourceDAO.java:63) at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) ... 35 more Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "FK_RESOURCES_APPLICATION: PUBLIC.RESOURCES FOREIGN KEY(APPLICATION) REFERENCES PUBLIC.RESOURCES(ID)"; SQL statement: delete from resources where id=? and version=? [23003-147] at org.h2.message.DbException.getJdbcSQLException(DbException.java:327) at org.h2.message.DbException.get(DbException.java:167) at org.h2.message.DbException.get(DbException.java:144) at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:382) at org.h2.constraint.ConstraintReferential.checkRowRefTable(ConstraintReferential.java:399) at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:275) at org.h2.table.Table.fireConstraints(Table.java:812) at org.h2.table.Table.fireAfterRow(Table.java:829) at org.h2.command.dml.Delete.update(Delete.java:80) at org.h2.command.CommandContainer.update(CommandContainer.java:69) at org.h2.command.Command.executeUpdate(Command.java:201) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143) at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2692) ... 55 more The app works, but this is disconcerting and I'm assuming someone should be aware of this. Attached roo script to create the simple test case project. (using roo 1.2.M1)

    Spring JIRA | 5 years ago | Bruce Edge
    org.hibernate.exception.ConstraintViolationException: could not delete: [com.springsource.insight.repo.resource.persist.PersistedApplicationResource#189]
  3. 0

    javax.persistence.PersistenceException

    GitHub | 3 years ago | guwirth
    org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "RULES_PLUGIN_KEY_AND_NAME ON PUBLIC.RULES(PLUGIN_RULE_KEY, PLUGIN_NAME)"; SQL statement:|insert into rules (id, cardinality, plugin_config_key, created_at, description, plugin_rule_key, language, name, parent_id, plugin_name, priority, status, updated_at) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-172]<|?at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)<|?at org.h2.message.DbException.get(DbException.java:169)<|?at org.h2.message.DbException.get(DbException.java:146)<|?at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:83)<|?at org.h2.index.PageBtree.find(PageBtree.java:121)<|?at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:148)<|?at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:101)<|?at org.h2.index.PageBtreeNode.addRowTry(PageBtreeNode.java:201)<|?at org.h2.index.PageBtreeNode.addRowTry(PageBtreeNode.java:201)<|?at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:104)<|?at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:95)<|?at org.h2.table.RegularTable.addRow(RegularTable.java:124)<|?at org.h2.command.dml.Insert.insertRows(Insert.java:126)<|?at org.h2.command.dml.Insert.update(Insert.java:86)<|?at org.h2.command.CommandContainer.update(CommandContainer.java:79)<|?at org.h2.command.Command.executeUpdate(Command.java:235)<|?at org.h2.server.TcpServerThread.process(TcpServerThread.java:335)<|?at org.h2.server.TcpServerThread.run(TcpServerThread.java:151)<|?at java.lang.Thread.run(Unknown Source)<|
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Grails: Hibernate and Data migrations

    Stack Overflow | 4 years ago | TroyB
    org.h2.jdbc.JdbcSQLException: NULL not allowed for column "ZIPCODE"; SQL statement: insert into customer (id, version, billaddr, billcity, billstate, billzipcode, cell, contact, country_id, custcode, custname, date_created, email, fax, last_updated, organization, phone, shipaddr, shipasbill, shipcity, shipstate, shipzipcode, status, tenant_id) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23502-164]
  6. 0

    MVCC and SELECT FOR UPDATE

    Google Groups | 6 years ago | Dashie
    org.h2.jdbc.JdbcSQLException: Timeout trying to lock table ; SQL statement: insert into materials (id, a, b, c, d, e, f) values (null, ?, ?, ?, ?, ?, 'a') [50200-168]

  1. j.kienzle 2 times, last 1 month ago
  2. tvrmsmith 1 times, last 5 hours ago
  3. Shadd518 4 times, last 4 months ago
  4. MoYapro 1 times, last 4 months ago
11 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.h2.jdbc.JdbcSQLException

    Referential integrity constraint violation: "FK_RESOURCES_APPLICATION: PUBLIC.RESOURCES FOREIGN KEY(APPLICATION) REFERENCES PUBLIC.RESOURCES(ID)"; SQL statement: delete from resources where id=? and version=? [23003-147]

    at org.h2.message.DbException.getJdbcSQLException()
  2. H2 Database Engine
    JdbcPreparedStatement.executeUpdate
    1. org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
    2. org.h2.message.DbException.get(DbException.java:167)
    3. org.h2.message.DbException.get(DbException.java:144)
    4. org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:382)
    5. org.h2.constraint.ConstraintReferential.checkRowRefTable(ConstraintReferential.java:399)
    6. org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:275)
    7. org.h2.table.Table.fireConstraints(Table.java:812)
    8. org.h2.table.Table.fireAfterRow(Table.java:829)
    9. org.h2.command.dml.Delete.update(Delete.java:80)
    10. org.h2.command.CommandContainer.update(CommandContainer.java:69)
    11. org.h2.command.Command.executeUpdate(Command.java:201)
    12. org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143)
    13. org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129)
    13 frames
  3. Commons DBCP
    DelegatingPreparedStatement.executeUpdate
    1. org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
    1 frame
  4. Hibernate
    AbstractEntityPersister.delete
    1. org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2692)
    2. org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2893)
    2 frames
  5. Hibernate
    EntityDeleteAction.execute
    1. org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
    1 frame
  6. Hibernate
    ActionQueue.executeActions
    1. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
    2. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
    3. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:189)
    3 frames
  7. Hibernate
    QueryImpl.list
    1. org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    2. org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
    3. org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185)
    4. org.hibernate.impl.SessionImpl.list(SessionImpl.java:1261)
    5. org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    5 frames
  8. Hibernate EJB
    QueryImpl.getSingleResult
    1. org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:274)
    1 frame
  9. com.springsource.insight
    JpaResourceDAO.findResource
    1. com.springsource.insight.repo.resource.persist.JpaResourceDAO.getResource(JpaResourceDAO.java:74)
    2. com.springsource.insight.repo.resource.persist.JpaResourceDAO.findResource(JpaResourceDAO.java:63)
    2 frames
  10. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    3. java.lang.reflect.Method.invoke(Method.java:597)
    3 frames
  11. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    3 frames
  12. Spring Tx
    PersistenceExceptionTranslationInterceptor.invoke
    1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
    1 frame
  13. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    1 frame
  14. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    1 frame
  15. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    2 frames
  16. Unknown
    $Proxy68.findResource
    1. $Proxy68.findResource(Unknown Source)
    1 frame
  17. com.springsource.insight
    PersistedResourceRepo.removeResource
    1. com.springsource.insight.repo.resource.persist.PersistedResourceRepo.removeResource(PersistedResourceRepo.java:175)
    1 frame
  18. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    3. java.lang.reflect.Method.invoke(Method.java:597)
    3 frames
  19. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    3 frames
  20. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    1 frame
  21. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    2 frames
  22. Unknown
    $Proxy71.removeResource
    1. $Proxy71.removeResource(Unknown Source)
    1 frame
  23. com.springsource.insight
    IncrementalPurgerImpl.purgeResources
    1. com.springsource.insight.repo.purge.IncrementalPurgerImpl.purgeResources(IncrementalPurgerImpl.java:86)
    1 frame
  24. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  25. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    3 frames
  26. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    1 frame
  27. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    2 frames
  28. Unknown
    $Proxy78.purgeResources
    1. $Proxy78.purgeResources(Unknown Source)
    1 frame
  29. com.springsource.insight
    PurgeServiceImpl$2.run
    1. com.springsource.insight.repo.purge.PurgeServiceImpl.purgeResources(PurgeServiceImpl.java:145)
    2. com.springsource.insight.repo.purge.PurgeServiceImpl.purgeData(PurgeServiceImpl.java:121)
    3. com.springsource.insight.repo.purge.PurgeServiceImpl.purgeExpiredData(PurgeServiceImpl.java:87)
    4. com.springsource.insight.repo.purge.PurgeServiceImpl$2.run(PurgeServiceImpl.java:177)
    4 frames
  30. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    3. java.lang.Thread.run(Thread.java:680)
    3 frames