private static DatabaseConfig loadDatabaseConfig(final HarvesterConfiguration config) throws ApplicationSetupException { final String pathname=config.databaseConfigPath(); try { LOGGER.info("Loading database configuration from {}...",pathname); final ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); final DatabaseConfig configuration = mapper.readValue(new File(pathname), DatabaseConfig.class); LOGGER.info("Database configuration loaded: {}",configuration); return configuration; } catch (final Exception e) { final String errorMessage = String.format("Could not load database configuration from %s",pathname); LOGGER.warn(errorMessage+". Full stacktrace follows: ",e); throw new ApplicationSetupException(errorMessage,e); } }
final String errorMessage="No target Jira Collector configured"; LOGGER.error("IT Harvester Application configuration failed: {}",errorMessage); throw new ApplicationSetupException(errorMessage); final String errorMessage = "Could not create publisher for target '"+this.target+"'"; LOGGER.error("IT Harvester Application configuration failed: {}. Full stacktrace follows: ",errorMessage,e); throw new ApplicationSetupException(errorMessage,e);