We're updating the issue view to help you get more done. 

Repeated CordFormations can fail with ClassLoader exception.

Description

In some cases, executing the Gradle task

1 $ ./gradlew samples:deployNodes

can break the Corda build with an exception like this:

1 2 3 4 5 6 7 8 9 10 Caused by: org.gradle.api.InvalidUserCodeException: net/corda/core/crypto/CompositeKey$Companion at net.corda.plugins.Baseform.bootstrapNetwork(Baseform.kt:232) at net.corda.plugins.Cordform.build(Cordform.kt:68) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) ... Caused by: java.lang.NoClassDefFoundError: net/corda/core/crypto/CompositeKey$Companion at net.corda.core.crypto.CompositeKey.<clinit>(CompositeKey.kt) at net.corda.core.crypto.CompositeKeyFactory.engineGeneratePublic(CompositeKeyFactory.kt:24) at net.corda.nodeapi.internal.crypto.X509CertificateFactory.generateCertificate(X509Utilities.kt:389) ...

The problem is that our cordformation Gradle plugin forgets to unload any SecurityProvider instances (e.g. BouncyCastle) that the Network Bootstrapper installs, which allows them to be used by and linked with other classes. This eventually results in a JVM linker exception.

SLF4J Configuration

In the interest of keeping the contents of the Network Bootstapper's ClassLoader as small as possible, we will also revert here. Any SLF4J back-end that the Network Bootstrapper wants to use can be set using Gradle's runtimeOnly configuration intead of testRuntime.

Status

Assignee

Chris Rankin

Reporter

Chris Rankin

Priority

Medium

Labels

Severity

Medium

Fix versions

Ported to...

None

Feature Team

Select team

Affects versions

Corda 4