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; } }