commit 967f378ac9f911c7265d994f68315148371733de
parent 43325087dc1b85f584d903c70bad1979781d3ac3
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Mon, 7 Oct 2019 13:05:05 +0200
abort all if XML processor didn't instantiate.
Diffstat:
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/src/main/kotlin/tech/libeufin/Main.kt b/src/main/kotlin/tech/libeufin/Main.kt
@@ -43,8 +43,14 @@ import javax.xml.bind.JAXBElement
fun main() {
- val xmlProcess = XML()
val logger = getLogger()
+ val xmlProcess = XML()
+
+ if (xmlProcess == null) {
+ logger.error("Could not load the XML processor, aborting")
+ return
+ }
+
dbCreateTables()
val server = embeddedServer(Netty, port = 5000) {
diff --git a/src/main/kotlin/tech/libeufin/XML.kt b/src/main/kotlin/tech/libeufin/XML.kt
@@ -54,16 +54,7 @@ class XML {
private val bundle = {
val classLoader = ClassLoader.getSystemClassLoader()
val schemas = arrayOf(
- // StreamSource(classLoader.getResourceAsStream("ebics_hev.xsd")),
- // StreamSource(classLoader.getResourceAsStream("ebics_H004.xsd")),
- // StreamSource(classLoader.getResourceAsStream("ebics_orders_H004.xsd")),
- StreamSource(classLoader.getResourceAsStream("xmldsig-core-schema.xsd")),
- StreamSource(classLoader.getResourceAsStream("ebics_types_H004.xsd")),
- // StreamSource(classLoader.getResourceAsStream("ebics_signature.xsd")),
- // StreamSource(classLoader.getResourceAsStream("ebics_response_H004.xsd")),
- // StreamSource(classLoader.getResourceAsStream("ebics_keymgmt_response_H004.xsd")),
- StreamSource(classLoader.getResourceAsStream("ebics_keymgmt_request_H004.xsd"))
-
+ StreamSource(classLoader.getResourceAsStream("ebics_hev.xsd"))
)
try {
@@ -71,7 +62,6 @@ class XML {
sf.newSchema(schemas)
} catch (e: SAXException) {
e.printStackTrace()
- // FIXME: must stop everything if schemas fail to load.
null
}
}()