From 1a4aaf32f07d02e9a0e57390c87660495d266c13 Mon Sep 17 00:00:00 2001 From: josecoll Date: Thu, 3 Oct 2019 15:46:54 +0100 Subject: [PATCH] CORDA-2050 Prevent node startup failure upon cross-platform execution. (#5527) * Prevent fat packaging of platform-specific JDK tools.jar (required at compile time for Java 8). * Catch Throwable. * Re-instate "tools.jar" in corda.jar as JRE's do not ship with this platform dependency. * Baseline "TooGenericExceptionCaught". --- detekt-baseline.xml | 2 +- node/src/main/kotlin/net/corda/node/utilities/JVMAgentUtil.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/detekt-baseline.xml b/detekt-baseline.xml index 7e40edf208..07d0b5cf0c 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -4224,7 +4224,7 @@ TooGenericExceptionCaught:InternalUtils.kt$ex: Exception TooGenericExceptionCaught:InternalUtils.kt$th: Throwable TooGenericExceptionCaught:IssueCash.kt$IssueCash$e: Exception - TooGenericExceptionCaught:JVMAgentUtil.kt$JVMAgentUtil$e: Exception + TooGenericExceptionCaught:JVMAgentUtil.kt$JVMAgentUtil$e: Throwable TooGenericExceptionCaught:JacksonSupport.kt$JacksonSupport.PartyDeserializer$e: Exception TooGenericExceptionCaught:JacksonSupport.kt$JacksonSupport.PublicKeyDeserializer$e: Exception TooGenericExceptionCaught:JacksonSupport.kt$JacksonSupport.SecureHashDeserializer$e: Exception diff --git a/node/src/main/kotlin/net/corda/node/utilities/JVMAgentUtil.kt b/node/src/main/kotlin/net/corda/node/utilities/JVMAgentUtil.kt index bf18198909..8162be5d68 100644 --- a/node/src/main/kotlin/net/corda/node/utilities/JVMAgentUtil.kt +++ b/node/src/main/kotlin/net/corda/node/utilities/JVMAgentUtil.kt @@ -16,8 +16,8 @@ object JVMAgentUtil { return try { val vm = VirtualMachine.attach(jvmPid) return vm.agentProperties - } catch (e: Exception) { - log.warn("Unable to determine whether checkpoint agent is running: ${e.message}.\n" + + } catch (e: Throwable) { + log.warn("Unable to determine whether agent is running: ${e.message}.\n" + "You may need to pass in -Djdk.attach.allowAttachSelf=true if running on a Java 9 or later VM") Properties() }