From f1a168046d05e70a5876f3b900da168987597a10 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Mon, 3 Apr 2017 17:06:30 +0100 Subject: [PATCH] Add 'finance' module to Corda WebServer, for plugins to use. (#489) * Add 'finance' module to Corda WebServer, for plugins to use. * Fix wording of error message. (cherry picked from commit 352da7e) --- .../test/kotlin/net/corda/demobench/model/NodeConfigTest.kt | 2 ++ webserver/build.gradle | 3 ++- .../kotlin/net/corda/webserver/internal/NodeWebServer.kt | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt index 57cd485484..e3b5853b1c 100644 --- a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt +++ b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt @@ -220,6 +220,8 @@ class NodeConfigTest { assertEquals(localPort(20001), webConfig.webAddress) assertEquals(localPort(10001), webConfig.p2pAddress) + assertEquals("trustpass", webConfig.trustStorePassword) + assertEquals("cordacadevpass", webConfig.keyStorePassword) } @Test diff --git a/webserver/build.gradle b/webserver/build.gradle index fb6dc46198..318cf9fb13 100644 --- a/webserver/build.gradle +++ b/webserver/build.gradle @@ -31,6 +31,7 @@ sourceSets { dependencies { compile project(':core') + compile project(':finance') compile project(':client:rpc') compile project(':client:jackson') testCompile project(':node') @@ -61,4 +62,4 @@ dependencies { task integrationTest(type: Test) { testClassesDir = sourceSets.integrationTest.output.classesDir classpath = sourceSets.integrationTest.runtimeClasspath -} \ No newline at end of file +} diff --git a/webserver/src/main/kotlin/net/corda/webserver/internal/NodeWebServer.kt b/webserver/src/main/kotlin/net/corda/webserver/internal/NodeWebServer.kt index d6fd2bdfd7..02b140a7a3 100644 --- a/webserver/src/main/kotlin/net/corda/webserver/internal/NodeWebServer.kt +++ b/webserver/src/main/kotlin/net/corda/webserver/internal/NodeWebServer.kt @@ -161,6 +161,11 @@ class NodeWebServer(val config: WebServerConfig) { } catch (e: java.nio.file.NoSuchFileException) { log.debug("Tried to open a file that doesn't yet exist, retrying", e) Thread.sleep(retryDelay) + } catch (e: Throwable) { + // E.g. a plugin cannot be instantiated? + // Note that we do want the exception stacktrace. + log.error("Cannot start WebServer", e) + throw e } } }