From 4d55104a0b3c3ca17228db929230ed6446101eac Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 28 Feb 2024 13:39:31 +0100 Subject: [PATCH] debug minimal docker setup --- .../sebserver/webservice/WebserviceInit.java | 28 +++++++++++-------- .../dao/impl/WebserviceInfoDAOImpl.java | 1 + 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java index 60be47b5..08956935 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java @@ -76,22 +76,26 @@ public class WebserviceInit implements ApplicationListener "); SEBServerInit.INIT_LOGGER.info("----> Register Webservice: {}", this.webserviceInfo.getWebserviceUUID()); - if (this.webserviceInfoDAO.isInitialized()) { - this.registerWebservice(); + try { + if (this.webserviceInfoDAO.isInitialized()) { + this.registerWebservice(); - // Apply migration if needed and possible - SEBServerInit.INIT_LOGGER.info("----> "); - this.sebServerMigrationStrategy.applyMigration(); - SEBServerInit.INIT_LOGGER.info("----> "); + // Apply migration if needed and possible + SEBServerInit.INIT_LOGGER.info("----> "); + this.sebServerMigrationStrategy.applyMigration(); + SEBServerInit.INIT_LOGGER.info("----> "); - } else { + } else { - // Apply migration if needed and possible - SEBServerInit.INIT_LOGGER.info("----> "); - this.sebServerMigrationStrategy.applyMigration(); - SEBServerInit.INIT_LOGGER.info("----> "); + // Apply migration if needed and possible + SEBServerInit.INIT_LOGGER.info("----> "); + this.sebServerMigrationStrategy.applyMigration(); + SEBServerInit.INIT_LOGGER.info("----> "); - this.registerWebservice(); + this.registerWebservice(); + } + } catch (final Exception e) { + SEBServerInit.INIT_LOGGER.error("Failed to apply data import and migration --> ", e); } SEBServerInit.INIT_LOGGER.info("----> "); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/WebserviceInfoDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/WebserviceInfoDAOImpl.java index b2d09865..dee1fe6f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/WebserviceInfoDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/WebserviceInfoDAOImpl.java @@ -57,6 +57,7 @@ public class WebserviceInfoDAOImpl implements WebserviceInfoDAO { .execute(); return true; } catch (final Exception e) { + log.warn("DB Context not initialized: ", e); return false; } }