Source:
<code>public void onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) { if (!settingsService.getModuleSettings().isRestartModuleAfterTimeout()) { return; } String symbolicName = event.getBundle().getSymbolicName(); if (event instanceof OsgiBundleContextFailedEvent) { if (!restartedBundles.contains(symbolicName)) { OsgiBundleContextFailedEvent failedEvent = (OsgiBundleContextFailedEvent) event; final String failureCauseMsg = failedEvent.getFailureCause().getMessage(); Bundle bundle = failedEvent.getBundle(); if (!failureCauseMsg.startsWith(String.format(TIMEOUT_EXCEPTION_MESSAGE, symbolicName))) { return; } LOGGER.error("Received context failed event from {}", event, symbolicName); LOGGER.error("{} failed to start due to {}", symbolicName, failureCauseMsg); logFailReport(symbolicName, failureCauseMsg, BundleRestartStatus.IN_PROGRESS); restartedBundles.add(symbolicName); LOGGER.info("Trying to restart bundle", symbolicName); try { bundle.stop(); bundle.start(); } catch (BundleException e) { LOGGER.error("Cannot restart bundle due to {}", symbolicName, e); } } else { OsgiBundleContextFailedEvent failedEvent = (OsgiBundleContextFailedEvent) event; <START> LOGGER.error("Cannot restart bundle due to {}", symbolicName, failedEvent.getFailureCause().getMessage()); <END> sendMessage("CRITICAL", String.format(CRITICAL_MESSAGE, symbolicName)); updateReportStatus(symbolicName, BundleRestartStatus.ERROR); } } else if (event instanceof OsgiBundleContextRefreshedEvent && restartedBundles.contains(symbolicName) ) { sendMessage("WARN", String.format(WARN_MESSAGE, symbolicName)); updateReportStatus(symbolicName, BundleRestartStatus.SUCCESS); restartedBundles.remove(symbolicName); } }</code><technical_language>current message implies restart of failure cause, in truth restart tried. Change lines restart bundle attempted it</technical_language>

Target:
public void onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) { if (!settingsService.getModuleSettings().isRestartModuleAfterTimeout()) { return; } String symbolicName = event.getBundle().getSymbolicName(); if (event instanceof OsgiBundleContextFailedEvent) { if (!restartedBundles.contains(symbolicName)) { OsgiBundleContextFailedEvent failedEvent = (OsgiBundleContextFailedEvent) event; final String failureCauseMsg = failedEvent.getFailureCause().getMessage(); Bundle bundle = failedEvent.getBundle(); if (!failureCauseMsg.startsWith(String.format(TIMEOUT_EXCEPTION_MESSAGE, symbolicName))) { return; } LOGGER.error("Received context failed event from {}", event, symbolicName); LOGGER.error("{} failed to start due to {}", symbolicName, failureCauseMsg); logFailReport(symbolicName, failureCauseMsg, BundleRestartStatus.IN_PROGRESS); restartedBundles.add(symbolicName); LOGGER.info("Trying to restart bundle", symbolicName); try { bundle.stop(); bundle.start(); } catch (BundleException e) { LOGGER.error("Cannot restart bundle due to {}", symbolicName, e); } } else { LOGGER.error("cannot restart bundle since it we already attempted it.", symbolicName); sendMessage("CRITICAL", String.format(RESTART_FAILURE_CRIT_MSG, symbolicName)); updateReportStatus(symbolicName, BundleRestartStatus.ERROR); } } else if (event instanceof OsgiBundleContextRefreshedEvent && restartedBundles.contains(symbolicName) ) { sendMessage("WARN", String.format(RESTART_SUCCESS_WARN_MSG, symbolicName)); updateReportStatus(symbolicName, BundleRestartStatus.SUCCESS); restartedBundles.remove(symbolicName); } }