From 48f4d298967a32ffa1c264c45bcd101fe4af2c7e Mon Sep 17 00:00:00 2001 From: anhefti Date: Fri, 23 Aug 2019 13:30:22 +0200 Subject: [PATCH] fix startup --- .../servicelayer/dao/impl/ConfigurationDAOBatchService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java index 3e1c360f..34358806 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java @@ -79,6 +79,11 @@ class ConfigurationDAOBatchService { log.info("Registered MyBatis Mappers: {}", batchSqlSessionTemplate.getConfiguration().getMapperRegistry().getMappers()); + // NOTE: sometimes this mapper was not registered on startup. No reason why. Force loading if absent. + if (!batchSqlSessionTemplate.getConfiguration().hasMapper(ConfigurationNodeRecordMapper.class)) { + batchSqlSessionTemplate.getConfiguration().addMapper(ConfigurationNodeRecordMapper.class); + } + this.batchConfigurationNodeRecordMapper = batchSqlSessionTemplate.getMapper(ConfigurationNodeRecordMapper.class); this.batchConfigurationValueRecordMapper =