diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java index df1ebd7b64c..5cc7b773dc9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java @@ -264,8 +264,10 @@ public class OperationMappingDAOImpl implements OperationMappingDAO { } } } catch (SQLException e) { - throw new OperationManagementDAOException("Error occurred while fetching pending operation mappings for " + - "active devices of type '" + deviceTypeId + "'", e); + String msg = "Error occurred while fetching pending operation mappings for " + + "active devices of type '" + deviceTypeId + "'"; + log.error(msg, e); + throw new OperationManagementDAOException(msg, e); } return enrolmentOperationMappingList; } diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/dao/util/HeartBeatBeaconDAOUtil.java b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/dao/util/HeartBeatBeaconDAOUtil.java index c131c3d43b4..67b91df5172 100644 --- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/dao/util/HeartBeatBeaconDAOUtil.java +++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/dao/util/HeartBeatBeaconDAOUtil.java @@ -62,29 +62,6 @@ public final class HeartBeatBeaconDAOUtil { } } - /** - * Cleanup resources used to transaction - * - * @param stmt Statement used - * @param rs Obtained results set - */ - public static void cleanupResources(Statement stmt, ResultSet rs) { - if (rs != null) { - try { - rs.close(); - } catch (SQLException e) { - log.warn("Error occurred while closing result set", e); - } - } - if (stmt != null) { - try { - stmt.close(); - } catch (SQLException e) { - log.warn("Error occurred while closing prepared statement", e); - } - } - } - /** * Lookup datasource using name and jndi properties * diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java index 5c742a984ea..4281a6bc58d 100644 --- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java +++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/src/main/java/io/entgra/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java @@ -85,6 +85,7 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic } } else { String msg = "Heart Beat Configuration Disabled. Server Context Information Not available."; + log.error(msg); throw new HeartBeatManagementException(msg); } return serverCtxInfo; @@ -129,6 +130,7 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic } } else { String msg = "Heart Beat Configuration Disabled. Updating Server Context Failed."; + log.error(msg); throw new HeartBeatManagementException(msg); } return uuid; @@ -161,6 +163,7 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic } } else { String msg = "Heart Beat Configuration Disabled. Error occurred while checking if server is qualified to execute randomly designated task."; + log.error(msg); throw new HeartBeatManagementException(msg); } return isQualified; @@ -204,6 +207,7 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic } } else { String msg = "Heart Beat Configuration Disabled. Updating acknowledged task list failed."; + log.error(msg); throw new HeartBeatManagementException(msg); } return result; @@ -245,6 +249,7 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic } } else { String msg = "Heart Beat Configuration Disabled. Error electing candidate for dynamic task execution."; + log.error(msg); throw new HeartBeatManagementException(msg); } }