SHARE
TWEET

Untitled

a guest Feb 4th, 2016 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. db.url=jdbc:derby:target/testdb;create=true;territory=en_US;collation=TERRITORY_BASED
  2. db.username=
  3. db.password=
  4.  
  5. # Hibernate
  6. hibernate.show_sql=true
  7. hibernate.hbm2ddl.auto=create
  8.    
  9. @Before
  10.   @Transactional(propagation = Propagation.REQUIRED, readOnly = false)
  11.   public void setUpDatabase() {
  12.     final Resource deleteScript = applicationContext.getResource("delete.sql");
  13.     final Resource insertScript = applicationContext.getResource("insert.sql");
  14.     SimpleJdbcTestUtils.executeSqlScript(simpleJdbcTemplate, deleteScript, true);
  15.     SimpleJdbcTestUtils.executeSqlScript(simpleJdbcTemplate, insertScript, false);
  16.   }
  17.    
  18. javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not insert: [ch.netcetera.gisab.masterdata.model.security.RuleTarget]
  19.     at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
  20.     at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:307)
  21.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  22.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  23.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  24.     at java.lang.reflect.Method.invoke(Method.java:597)
  25.     at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:198)
  26.     at $Proxy47.flush(Unknown Source)
  27.     at ch.netcetera.gisab.masterdata.dao.RuleDAOImpl.updateRuleTargetsOfRule(RuleDAOImpl.java:84)
  28.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  29.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  30.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  31.     at java.lang.reflect.Method.invoke(Method.java:597)
  32.     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
  33.     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
  34.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
  35.     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
  36.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
  37.     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
  38.     at $Proxy72.updateRuleTargetsOfRule(Unknown Source)
  39.     at ch.netcetera.gisab.masterdata.services.RoleServiceImpl.updateUserRoleTO(RoleServiceImpl.java:145)
  40.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  41.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  42.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  43.     at java.lang.reflect.Method.invoke(Method.java:597)
  44.     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
  45.     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
  46.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
  47.     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
  48.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
  49.     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
  50.     at $Proxy74.updateUserRoleTO(Unknown Source)
  51.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  52.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  53.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  54.     at java.lang.reflect.Method.invoke(Method.java:597)
  55.     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
  56.     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
  57.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
  58.     at org.springframework.aop.interceptor.CustomizableTraceInterceptor.invokeUnderTrace(CustomizableTraceInterceptor.java:255)
  59.     at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:110)
  60.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
  61.     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
  62.     at $Proxy74.updateUserRoleTO(Unknown Source)
  63.     at ch.netcetera.gisab.masterdata.services.RoleServiceTest.testUpdateUserRoleTO(RoleServiceTest.java:140)
  64.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  65.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  66.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  67.     at java.lang.reflect.Method.invoke(Method.java:597)
  68.     at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
  69.     at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
  70.     at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
  71.     at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
  72.     at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
  73.     at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
  74.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
  75.     at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
  76.     at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
  77.     at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
  78.     at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
  79.     at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
  80.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
  81.     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
  82.     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  83.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
  84.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  85.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  86.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  87. Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [ch.netcetera.gisab.masterdata.model.security.RuleTarget]
  88.     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
  89.     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
  90.     at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2295)
  91.     at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)
  92.     at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
  93.     at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
  94.     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
  95.     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
  96.     at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
  97.     at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
  98.     at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
  99.     at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:304)
  100.     ... 66 more
  101. Caused by: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL091001075326220' defined on 'RULETARGET'.
  102.     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
  103.     at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
  104.     at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
  105.     at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
  106.     at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
  107.     at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
  108.     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
  109.     at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
  110.     at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
  111.     at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
  112.     at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
  113.     at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2275)
  114.     ... 75 more
  115. Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL091001075326220' defined on 'RULETARGET'.
  116.     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
  117.     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
  118.     ... 87 more
  119. Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL091001075326220' defined on 'RULETARGET'.
  120.     at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  121.     at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
  122.     at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
  123.     at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
  124.     at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
  125.     at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
  126.     at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
  127.     at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
  128.     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
  129.     ... 81 more
  130.    
  131. 2009-10-01 10:16:38,924 | main            | WARN  | JDBCExceptionReporter          | SQL Warning: 10000, SQLState: 01J01
  132. 2009-10-01 10:16:38,924 | main            | WARN  | JDBCExceptionReporter          | Database 'target/testdb' not created, connection made to existing database instead.
  133. Hibernate: insert into RuleTarget (ruleid, targetid, type, version, id) values (?, ?, ?, ?, ?)
  134. 2009-10-01 10:16:38,939 | main            | WARN  | JDBCExceptionReporter          | SQL Error: 20000, SQLState: 23505
  135. 2009-10-01 10:16:38,939 | main            | ERROR | JDBCExceptionReporter          | The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL091001101631840' defined on 'RULETARGET'.
  136. 2009-10-01 10:16:38,939 | main            | ERROR | AbstractFlushingEventListener  | Could not synchronize database state with session
  137. org.hibernate.exception.ConstraintViolationException: could not insert: [ch.netcetera.gisab.masterdata.model.security.RuleTarget]
  138.    
  139. <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
  140. <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top