diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt index 19df298f0f..ad7603463b 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/FlowStateMachineImpl.kt @@ -318,6 +318,9 @@ class FlowStateMachineImpl(override val id: StateMachineRunId, } private fun openThreadLocalWormhole() { + // This sets the Cordapp classloader on the contextClassLoader of the current thread. + // Needed because in previous versions of the finance app we used Thread.contextClassLoader to resolve services defined in cordapps. + Thread.currentThread().contextClassLoader = serviceHub.cordappProvider.appClassLoader val threadLocal = transientValues.database.hikariPoolThreadLocal if (threadLocal != null) { val valueFromThread = swappedOutThreadLocalValue(threadLocal)