Uploaded image for project: 'Corda'
  1. CORDA-2676

Repeated CordFormations can fail with ClassLoader exception.

    Details

    • Severity:
      Medium
    • Feature Team:
      Select team
    • Sprint:

      Description

      In some cases, executing the Gradle task

      $ ./gradlew samples:deployNodes
      

      can break the Corda build with an exception like this:

      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 CORDA-2612 Done here. Any SLF4J back-end that the Network Bootstrapper wants to use can be set using Gradle's runtimeOnly configuration intead of testRuntime.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                chris.rankin Chris Rankin
                Reporter:
                chris.rankin Chris Rankin
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: