How to exit cash while using confidential identities in V2 - corda

I noticed that the change (Add confidential identity support to cash exit logic #1849) is not in release-V2, any reason why is it not implemented in V2 (OnLedgerAsset) ? I'm using Corda 2.0 and cash using confidential identities cannot be exited properly.
net.corda.finance.flows.CashException: Exiting more cash than exists
at net.corda.finance.flows.CashExitFlow.call(CashExitFlow.kt:58)
at net.corda.finance.flows.CashExitFlow.call(CashExitFlow.kt:29)
at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:243)
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96)
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:41)
at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092)
at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788)
at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100)
at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:69)
Caused by: net.corda.core.contracts.InsufficientBalanceException: Insufficient balance, missing 2000.00 THB issued by C=UK,L=London,O=Bank1[00]
at net.corda.finance.contracts.asset.OnLedgerAsset$Companion.generateExit(OnLedgerAsset.kt:238)
at net.corda.finance.contracts.asset.OnLedgerAsset.generateExit(OnLedgerAsset.kt:303)
at net.corda.finance.flows.CashExitFlow.call(CashExitFlow.kt:53)
... 17 more

This appears to be a bug. I've reported it here: https://github.com/corda/corda/issues/2342 and created a JIRA ticket here: https://r3-cev.atlassian.net/browse/CORDA-913.

Related

How to debug quasar error in a corda flow test?

While running flow unit tests with the MockNetwork for a validating notary, I keep getting flow test failures with ‘Transaction context is missing’ error. I have thoroughly verified there is no method that is missing the #Suspendable annotation. On debugging I noticed that the FinalityFlow fails to successfully run the Notary.Client flow, as the latter fails to suspend at the FlowStateMachine. From Stack Overflow, I found an earlier post on this error. Adding this flag -Dco.paralleluniverse.fibers.verifyInstrumentation=true however, gave me no additional information in the output. I am building my cordapp with corda 4.3 Open Source and using the quasar-0.7.10 jar as recommended in the corda documentation.
Am I missing something here - do I need to change the logging levels? Is the information being sent to a file? How can I correctly instrument the flow test to get more details on the execution?
Here is the exception I see while running my tests.
[INFO ] 11:36:28.623 [Mock network] flow. - Flow raised an error: Transaction context is missing. This might happen if a suspendable method is not annotated with #Suspendable annotation.. Sending it to flow hospital to be triaged.
[WARN ] 11:36:28.624 [Mock network] flow. - Caught exception from flow
java.lang.IllegalArgumentException: Transaction context is missing. This might happen if a suspendable method is not annotated with #Suspendable annotation.
at net.corda.node.services.statemachine.FlowStateMachineImpl.checkDbTransaction(FlowStateMachineImpl.kt:230) ~[corda-node-4.3.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.processEventImmediately(FlowStateMachineImpl.kt:221) ~[corda-node-4.3.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:291) ~[corda-node-4.3.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:46) ~[corda-node-4.3.jar:?]
at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_192]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_192]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_192]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_192]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_192]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_192]
at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:63) ~[corda-node-4.3.jar:?]
The MockNetwork is initialized as follows.
val testCordapps = cordappPackages.map { TestCordapp.findCordapp(it) }
val mockNetwork = MockNetwork(
MockNetworkParameters(
cordappsForAllNodes = testCordapps,
notarySpecs = listOf(MockNetworkNotarySpec(NOTARY_LEGAL_NAME, validating = true))
)
)

Corda fails to perform a simple flow with "Exception while scanning" caused by Java heap space OOM

Works fine in Corda 3.3 but fails in Corda 4.0
Node gets up properly and then when I call first very simple flow - this error happens.
I tried to run node with 2048 heap space but no success.
Stacktrace:
java.lang.RuntimeException: java.util.concurrent.ExecutionException:
Exception while scanning at
io.github.classgraph.ClassGraph.scan(ClassGraph.java:1153)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.ClassGraph.scan(ClassGraph.java:1173)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.ClassGraph.scan(ClassGraph.java:1185)
~[classgraph-4.6.12.jar:4.6.12] at
net.corda.core.internal.ClassGraphUtilsKt.pooledScan(ClassGraphUtils.kt:18)
~[corda-core-4.0.jar:?] at
net.corda.core.internal.ClassLoadingUtilsKt.createInstancesOfClassesImplementing(ClassLoadingUtils.kt:22)
~[corda-core-4.0.jar:?] at
net.corda.core.serialization.internal.AttachmentsClassLoaderBuilder$withAttachmentsClassloaderContext$serializationContext$1.apply(AttachmentsClassLoader.kt:316)
~[corda-core-4.0.jar:?] at
net.corda.core.serialization.internal.AttachmentsClassLoaderBuilder$withAttachmentsClassloaderContext$serializationContext$1.apply(AttachmentsClassLoader.kt:293)
~[corda-core-4.0.jar:?] at
java.util.HashMap.computeIfAbsent(HashMap.java:1127) ~[?:1.8.0_191]
at
java.util.Collections$SynchronizedMap.computeIfAbsent(Collections.java:2672)
~[?:1.8.0_191] at
net.corda.core.serialization.internal.AttachmentsClassLoaderBuilder.withAttachmentsClassloaderContext(AttachmentsClassLoader.kt:313)
~[corda-core-4.0.jar:?] at
net.corda.core.serialization.internal.AttachmentsClassLoaderBuilder.withAttachmentsClassloaderContext$default(AttachmentsClassLoader.kt:310)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.LedgerTransaction.internalPrepareVerify$core(LedgerTransaction.kt:135)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.LedgerTransaction.verify(LedgerTransaction.kt:125)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.TransactionBuilder.addMissingDependency(TransactionBuilder.kt:173)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.TransactionBuilder.toWireTransactionWithContext$core(TransactionBuilder.kt:160)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.TransactionBuilder.toWireTransactionWithContext$core$default(TransactionBuilder.kt:128)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.TransactionBuilder.toWireTransaction(TransactionBuilder.kt:125)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.TransactionBuilder.toLedgerTransaction(TransactionBuilder.kt:451)
~[corda-core-4.0.jar:?] at
net.corda.core.transactions.TransactionBuilder.verify(TransactionBuilder.kt:459)
~[corda-core-4.0.jar:?] at
com.insettle.core.corda.flows.abstractions.AbstractInitiatingFlow.call(AbstractInitiatingFlow.kt:60)
~[?:?] at
com.insettle.core.corda.flows.abstractions.AbstractInitiatingFlow.call(AbstractInitiatingFlow.kt:12)
~[?:?] at
net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:228)
~[corda-node-4.0.jar:?] at
net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:45)
~[corda-node-4.0.jar:?] at
co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092)
~[quasar-core-0.7.10-jdk8.jar:0.7.10] at
co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788)
~[quasar-core-0.7.10-jdk8.jar:0.7.10] at
co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100)
~[quasar-core-0.7.10-jdk8.jar:0.7.10] at
co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91)
~[quasar-core-0.7.10-jdk8.jar:0.7.10] at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
~[?:1.8.0_191] at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
~[?:1.8.0_191] at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
~[?:1.8.0_191] at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
~[?:1.8.0_191] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
~[?:1.8.0_191] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
~[?:1.8.0_191] at
net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:63)
~[corda-node-4.0.jar:?] Caused by:
java.util.concurrent.ExecutionException: Exception while scanning at
io.github.classgraph.Scanner.call(Scanner.java:716)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.Scanner.call(Scanner.java:63)
~[classgraph-4.6.12.jar:4.6.12] at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
~[?:1.8.0_191] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
~[?:1.8.0_191] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
~[?:1.8.0_191] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: java.lang.OutOfMemoryError: Java heap space at
io.github.classgraph.ClassInfo.(ClassInfo.java:154)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.ClassInfo.(ClassInfo.java:169)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.ClassInfo.addScannedClass(ClassInfo.java:489)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.ClassInfoUnlinked.link(ClassInfoUnlinked.java:168)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.Scanner.call(Scanner.java:649)
~[classgraph-4.6.12.jar:4.6.12] at
io.github.classgraph.Scanner.call(Scanner.java:63)
~[classgraph-4.6.12.jar:4.6.12] at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
~[?:1.8.0_191] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
~[?:1.8.0_191] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
~[?:1.8.0_191] at java.lang.Thread.run(Thread.java:748)
~[?:1.8.0_191]
This issue is probably related to the custom whitelist serialization scanning code.
We need to raise max heap size of nodes to 1GB. See following link for details -
https://r3-cev.atlassian.net/browse/CORDA-2436
Also refer -
https://r3-cev.atlassian.net/browse/CORDA-2437?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
The stack trace shows:
at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1185) ~[classgraph-4.6.12.jar:4.6.12]
at net.corda.core.internal.ClassGraphUtilsKt.pooledScan(ClassGraphUtils.kt:18) ~[corda-core-4.0.jar:?]
at net.corda.core.internal.ClassLoadingUtilsKt.createInstancesOfClassesImplementing(ClassLoadingUtils.kt:22) ~[corda-core-4.0.jar:?]
In other words it looks like every time createInstancesOfClassesImplementing is called, a new ClassGraph scan is initiated. Assuming that this method is called many times, then not only is that extremely inefficient, but scanning the entire classpath for each new scan could result in a huge amount of memory overhead, if a reference to the ScanResult is held for each new scan.
The stacktrace shows two separate scans going on at the same time too, so you are probably initiating the scan from more than one thread at a time.
The right way to solve this is to scan the classpath just once on initialization, then reuse the ScanResult in ClassLoadingUtilsKt, rather than re-scanning to generate a new ScanResult each time.

Sbt outjava.io.IOException: No such file or directory

Searching on the internet the only relevant information found is at https://github.com/sbt/sbt/issues/2156#issuecomment-140359444; however I don't see the solution for this problem.
The project is freshly setup with Java 1.8.0_131-b11 64bits, Scala 2.11.11, sbt 0.13.15. Basically there is no plugins just a standard sbt layout project. Although frequency of such errors is not very high, it's inconvenience as not sure how to fix that.
Is there any solution for this issue? Thanks
/path/to/target/streams/$global/ivySbt/$global/streams/outjava.io.IOException: No such file or directory
at sbt.ErrorHandling$.translate(ErrorHandling.scala:10)
at sbt.IO$.touch(IO.scala:210)
at sbt.std.Streams$$anon$3$$anon$2.make(Streams.scala:129)
at sbt.std.Streams$$anon$3$$anon$2.text(Streams.scala:113)
at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:124)
at sbt.std.TaskStreams$class.log(Streams.scala:56)
at sbt.std.Streams$$anon$3$$anon$2.log$lzycompute(Streams.scala:102)
at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:102)
at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1338)
at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1337)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1012)
at sbt.IO$$anonfun$1.apply$mcZ$sp(IO.scala:210)
at sbt.IO$$anonfun$1.apply(IO.scala:210)
at sbt.IO$$anonfun$1.apply(IO.scala:210)
at sbt.ErrorHandling$.translate(ErrorHandling.scala:10)
at sbt.IO$.touch(IO.scala:210)
at sbt.std.Streams$$anon$3$$anon$2.make(Streams.scala:129)
at sbt.std.Streams$$anon$3$$anon$2.text(Streams.scala:113)
at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:124)
at sbt.std.TaskStreams$class.log(Streams.scala:56)
at sbt.std.Streams$$anon$3$$anon$2.log$lzycompute(Streams.scala:102)
at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:102)
at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1338)
at sbt.Classpaths$$anonfun$ivySbt0$1.apply(Defaults.scala:1337)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)

corda M13.0 - Integration Testing of an Oracle

I followed the oracle-example to create a dummy FX rate oracle. It passed the MockNetwork tests. Now in the integration test via driver, I get the following FlowSessionException complaining "flow has not been registered".
My other integration tests don't need to register any flows. Is it peculiar to the oracle service?
How do I register an initiating flow in the test?
net.corda.core.flows.FlowSessionException: Party CN=FX Rate Oracle,O=FX Rate Oracle,L=San Francisco,C=US,OU=argent.fxrate_oracle rejected session request: argent.flow.FXRateQueryFlow has not been registered
at net.corda.node.services.statemachine.FlowStateMachineImpl.waitForConfirmation(FlowStateMachineImpl.kt:266) ~[corda-node-0.13.0.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.startNewSession(FlowStateMachineImpl.kt:326) ~[corda-node-0.13.0.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.sendAndReceive(FlowStateMachineImpl.kt:169) ~[corda-node-0.13.0.jar:?]
at net.corda.core.internal.FlowStateMachine$DefaultImpls.sendAndReceive$default(FlowStateMachine.kt:22) ~[corda-core-0.13.0.jar:?]
at net.corda.core.flows.FlowLogic.sendAndReceive(FlowLogic.kt:89) ~[corda-core-0.13.0.jar:?]
at argent.flow.FXRateQueryFlow.call(FXRateQueryFlow.kt:20) ~[service-interface-0.1.jar:?]
at argent.flow.FXRateQueryFlow.call(FXRateQueryFlow.kt:14) ~[service-interface-0.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:107) [corda-node-0.13.0.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:39) [corda-node-0.13.0.jar:?]
at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1067) [quasar-core-0.7.6-jdk8.jar:0.7.6]
at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:767) [quasar-core-0.7.6-jdk8.jar:0.7.6]
at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) [quasar-core-0.7.6-jdk8.jar:0.7.6]
at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) [quasar-core-0.7.6-jdk8.jar:0.7.6]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:69) [corda-node-0.13.0.jar:?]
Not sure if this is the answer to my own question. But the fix seems to be moving the QueryHandler class out of the object wrapper into a standalone class file.
That is not necessary for many of our other InitiatedBy flow and they seem to self-register properly. Only the flow included in the same object wrapper as the #CordaService class does not seem to be able to self-register.
Seems to a bug to me.
\Sean

spring-boot-actuator 1.2.5.RELEASE throws error on container start up

A little background:
I am trying to use spring-boot-actuator in spring MVC application that we have in production. It is NOT a spring-boot-application.
I have put together a simple spring MVC App with spring-boot-actuator.
The sample code is available here. It is simple app to clone and reproduce the error. I have README with instructions in there.
I have used spring-boot-actuator 1.1.1.RELEASE dependency and it works fine.
However, when I wanted to use 1.2.5.RELEASE and that is where I get errors during container start up.
SEVERE: StandardWrapper.Throwable
java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration$RequestMappingEndpointConfiguration#requestMappingEndpoint due to internal class not found. This can happen if you are #ComponentScanning a springframework package (e.g. if you put a #ComponentScan in the default package by mistake)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:51)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:92)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:174)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:136)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:324)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:530)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1091)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/SmartInitializingSingleton
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:163)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:152)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:120)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:95)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:45)
... 30 more
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.SmartInitializingSingleton
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 42 more
Sep 05, 2015 9:09:42 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /MyController threw load() exception
java.lang.ClassNotFoundException: org.springframework.beans.factory.SmartInitializingSingleton
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:163)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:152)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:120)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:95)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:45)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:92)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:174)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:136)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:324)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:530)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1091)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
You're using an old and incompatible version of Spring Framework. I'd guess 4.0.x.
SmartInitializingSingleton is new in Spring Framework 4.1. Furthermore, as described in the documentation, Spring Boot 1.2.5 requires Spring Framework 4.1.5.RELEASE or above.

Resources