New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DriverDSLImpl: incompatible API between Corda CE and OS (4.6.1) #6826
Labels
Comments
Automatically created Jira issue: CORDA-4090 |
For the unlikely future bloke looking for a workaround, i used this in my node driver helper: fun createDriver(defaultParameters: DriverParameters ): DriverDSLImpl {
val driverParams = mapOf(
"portAllocation" to defaultParameters.portAllocation,
"debugPortAllocation" to defaultParameters.debugPortAllocation,
"systemProperties" to defaultParameters.systemProperties,
"driverDirectory" to defaultParameters.driverDirectory.toAbsolutePath(),
"useTestClock" to defaultParameters.useTestClock,
"isDebug" to defaultParameters.isDebug,
"startNodesInProcess" to defaultParameters.startNodesInProcess,
"waitForAllNodesToFinish" to defaultParameters.waitForAllNodesToFinish,
"extraCordappPackagesToScan" to emptyList<String>(),//@Suppress("DEPRECATION") defaultParameters.extraCordappPackagesToScan,
"notarySpecs" to defaultParameters.notarySpecs,
"jmxPolicy" to defaultParameters.jmxPolicy,
"compatibilityZone" to null,
"networkParameters" to defaultParameters.networkParameters,
"notaryCustomOverrides" to defaultParameters.notaryCustomOverrides,
"inMemoryDB" to defaultParameters.inMemoryDB,
"cordappsForAllNodes" to defaultParameters.cordappsForAllNodes as Collection<TestCordappInternal>?,
"djvmBootstrapSource" to defaultParameters.djvmBootstrapSource,
"djvmCordaSource" to defaultParameters.djvmCordaSource,
"environmentVariables" to defaultParameters.environmentVariables,
"enableSNI" to true,
"allowHibernateToManageAppSchema" to true,
"premigrateH2Database" to true
)
return createDriver(DriverDSLImpl::class, driverParams)
}
/**
* A reflection-based tmp fix for managing differences
* between Corda 4.0 and 4.6, also servig as a workaround for
* - https://github.com/corda/corda/issues/6826
* - https://r3-cev.atlassian.net/browse/CORDA-4090
*/
fun <T: Any> createDriver(
targetClass: KClass<T>,
parameters: Map<String,Any?>,
targetConstructor: KFunction<T> = targetClass.primaryConstructor!!
):T{
val constructorParameters = targetConstructor.parameters.associateBy({it},{ parameters[it.name] })
return targetConstructor.callBy(constructorParameters)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tools designed to use OS'
DriverDSLImpl
fail constructing an instance of the same class using CE.The reason seems to be that CE adds an
enableSNI: Boolean
constructor parameter, perhaps without a default value.Try to construct an instance like
Corda CE 4.6.1
The text was updated successfully, but these errors were encountered: