This repository is deprecated. The latest version of all the official CorDapp samples can be found in the official samples repository: https://github.com/corda/samples.
Other
0
stars
4
forks
source link
MakePledge flow tests fail in recording as observer #1
If you run the MakePledgeTests, the flow fails with the following stack trace:
[WARN ] 11:26:10,321 [Mock node 2 thread] (FlowStateMachineImpl.kt:111) flow.[4a071f1e-5d44-4eb3-9d10-51bc6fd3a8cf].run - Terminated by unexpected exception {}
rx.exceptions.OnErrorNotImplementedException: org.hibernate.exception.ConstraintViolationException: could not execute statement
at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:386) ~[rxjava-1.2.4.jar:1.2.4]
at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:383) ~[rxjava-1.2.4.jar:1.2.4]
at rx.internal.util.ActionSubscriber.onError(ActionSubscriber.java:44) ~[rxjava-1.2.4.jar:1.2.4]
at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:153) ~[rxjava-1.2.4.jar:1.2.4]
at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:115) ~[rxjava-1.2.4.jar:1.2.4]
at rx.exceptions.Exceptions.throwOrReport(Exceptions.java:216) ~[rxjava-1.2.4.jar:1.2.4]
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139) ~[rxjava-1.2.4.jar:1.2.4]
at rx.subjects.PublishSubject$PublishSubjectProducer.onNext(PublishSubject.java:304) ~[rxjava-1.2.4.jar:1.2.4]
at rx.subjects.PublishSubject$PublishSubjectState.onNext(PublishSubject.java:219) ~[rxjava-1.2.4.jar:1.2.4]
at rx.subjects.PublishSubject.onNext(PublishSubject.java:72) ~[rxjava-1.2.4.jar:1.2.4]
at rx.internal.util.ObserverSubscriber.onNext(ObserverSubscriber.java:34) ~[rxjava-1.2.4.jar:1.2.4]
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134) ~[rxjava-1.2.4.jar:1.2.4]
at rx.subjects.PublishSubject$PublishSubjectProducer.onNext(PublishSubject.java:304) ~[rxjava-1.2.4.jar:1.2.4]
at rx.subjects.PublishSubject$PublishSubjectState.onNext(PublishSubject.java:219) ~[rxjava-1.2.4.jar:1.2.4]
at rx.subjects.PublishSubject.onNext(PublishSubject.java:72) ~[rxjava-1.2.4.jar:1.2.4]
at net.corda.node.services.vault.NodeVaultService.processAndNotify(NodeVaultService.kt:203) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.vault.NodeVaultService.access$processAndNotify(NodeVaultService.kt:47) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.vault.NodeVaultService$notifyAll$1.invoke(NodeVaultService.kt:116) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.vault.NodeVaultService.notifyAll(NodeVaultService.kt:126) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.api.ServiceHubInternal$DefaultImpls.recordTransactions(ServiceHubInternal.kt:118) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.internal.AbstractNode$ServiceHubInternalImpl$recordTransactions$1.invoke(AbstractNode.kt:811) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.internal.AbstractNode$ServiceHubInternalImpl$recordTransactions$1.invoke(AbstractNode.kt:772) ~[corda-node-corda-3.0.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:132) ~[corda-node-api-corda-3.0.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:120) ~[corda-node-api-corda-3.0.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:127) ~[corda-node-api-corda-3.0.jar:?]
at net.corda.node.internal.AbstractNode$ServiceHubInternalImpl.recordTransactions(AbstractNode.kt:810) ~[corda-node-corda-3.0.jar:?]
at net.corda.core.flows.ReceiveTransactionFlow.call(ReceiveTransactionFlow.kt:50) ~[corda-core-corda-3.0.jar:?]
at net.corda.core.flows.ReceiveTransactionFlow.call(ReceiveTransactionFlow.kt:24) ~[corda-core-corda-3.0.jar:?]
at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:290) ~[corda-core-corda-3.0.jar:?]
at net.corda.demos.crowdFunding.flows.RecordTransactionAsObserver.call(RecordTransactionAsObserver.kt:32) ~[classes/:?]
at net.corda.demos.crowdFunding.flows.RecordTransactionAsObserver.call(RecordTransactionAsObserver.kt:20) ~[classes/:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96) [corda-node-corda-3.0.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:44) [corda-node-corda-3.0.jar:?]
at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) [quasar-core-0.7.9-jdk8.jar:0.7.9]
at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) [quasar-core-0.7.9-jdk8.jar:0.7.9]
at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) [quasar-core-0.7.9-jdk8.jar:0.7.9]
at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) [quasar-core-0.7.9-jdk8.jar:0.7.9]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62) [corda-node-corda-3.0.jar:?]
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1434) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1414) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at net.corda.node.services.schema.HibernateObserver.persistStatesWithSchema$node(HibernateObserver.kt:66) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver.persist(HibernateObserver.kt:50) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver.access$persist(HibernateObserver.kt:29) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver$Companion$install$1.call(HibernateObserver.kt:34) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver$Companion$install$1.call(HibernateObserver.kt:30) ~[corda-node-corda-3.0.jar:?]
at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39) ~[rxjava-1.2.4.jar:1.2.4]
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134) ~[rxjava-1.2.4.jar:1.2.4]
... 37 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:207) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3001) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3501) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:586) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:460) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1428) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1414) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at net.corda.node.services.schema.HibernateObserver.persistStatesWithSchema$node(HibernateObserver.kt:66) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver.persist(HibernateObserver.kt:50) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver.access$persist(HibernateObserver.kt:29) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver$Companion$install$1.call(HibernateObserver.kt:34) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver$Companion$install$1.call(HibernateObserver.kt:30) ~[corda-node-corda-3.0.jar:?]
at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39) ~[rxjava-1.2.4.jar:1.2.4]
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134) ~[rxjava-1.2.4.jar:1.2.4]
... 37 more
Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_D ON PUBLIC.PLEDGES(OUTPUT_INDEX, TRANSACTION_ID) VALUES (0, '479DC2CD5557F26321F1A7748773925F0817CB19FEAC567536921752DBD050A4', 1)"; SQL statement:
insert into pledges (amount, campaign_reference, currency, linear_id, manager, pledger, output_index, transaction_id) values (?, ?, ?, ?, ?, ?, ?, ?) [23505-194]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) ~[h2-1.4.194.jar:1.4.194]
at org.h2.message.DbException.get(DbException.java:179) ~[h2-1.4.194.jar:1.4.194]
at org.h2.message.DbException.get(DbException.java:155) ~[h2-1.4.194.jar:1.4.194]
at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103) ~[h2-1.4.194.jar:1.4.194]
at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:231) ~[h2-1.4.194.jar:1.4.194]
at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:190) ~[h2-1.4.194.jar:1.4.194]
at org.h2.mvstore.db.MVTable.addRow(MVTable.java:707) ~[h2-1.4.194.jar:1.4.194]
at org.h2.command.dml.Insert.insertRows(Insert.java:156) ~[h2-1.4.194.jar:1.4.194]
at org.h2.command.dml.Insert.update(Insert.java:114) ~[h2-1.4.194.jar:1.4.194]
at org.h2.command.CommandContainer.update(CommandContainer.java:101) ~[h2-1.4.194.jar:1.4.194]
at org.h2.command.Command.executeUpdate(Command.java:258) ~[h2-1.4.194.jar:1.4.194]
at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:160) ~[h2-1.4.194.jar:1.4.194]
at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:146) ~[h2-1.4.194.jar:1.4.194]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-2.5.1.jar:?]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-2.5.1.jar:?]
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3001) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3501) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:586) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:460) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1428) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1414) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at net.corda.node.services.schema.HibernateObserver.persistStatesWithSchema$node(HibernateObserver.kt:66) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver.persist(HibernateObserver.kt:50) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver.access$persist(HibernateObserver.kt:29) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver$Companion$install$1.call(HibernateObserver.kt:34) ~[corda-node-corda-3.0.jar:?]
at net.corda.node.services.schema.HibernateObserver$Companion$install$1.call(HibernateObserver.kt:30) ~[corda-node-corda-3.0.jar:?]
at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39) ~[rxjava-1.2.4.jar:1.2.4]
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134) ~[rxjava-1.2.4.jar:1.2.4]
... 37 more
If you run the
MakePledgeTests
, the flow fails with the following stack trace: