diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java
index 4aaf8bf06f..bd0223e962 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java
@@ -93,7 +93,7 @@ public interface DeviceManagementProviderService extends OperationManager {
void updateDeviceEnrolmentInfo(Device device, EnrolmentInfo.Status active) throws DeviceManagementException;
/**
- * This method is used to retrieve list of devices based on the device status
+ * This method is used to retrieve list of devices based on the device status.
*
* @param status Device status
* @return List of devices
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
index 197a9321e3..3e05baf788 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
@@ -492,8 +492,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
Device device;
try {
+ DeviceManagementDAOFactory.openConnection();
device = deviceDAO.getDevice(deviceId, this.getTenantId());
- } catch (DeviceManagementDAOException e) {
+ } catch (DeviceManagementDAOException | SQLException e) {
throw new DeviceManagementException("Error occurred while obtaining the device for id " +
"'" + deviceId.getId() + "'", e);
} finally {
@@ -731,10 +732,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
DeviceManagementDAOFactory.closeConnection();
}
for (Device device : userDevices) {
- Device dmsDevice =
- this.getPluginRepository().getDeviceManagementService(
- device.getType()).getDeviceManager().getDevice(
- new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
+ Device dmsDevice = this.getDeviceManager(device.getType()).
+ getDevice(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
if (dmsDevice != null) {
device.setFeatures(dmsDevice.getFeatures());
device.setProperties(dmsDevice.getProperties());
@@ -771,10 +770,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
DeviceManagementDAOFactory.closeConnection();
}
for (Device device : allDevices) {
- Device dmsDevice =
- this.getPluginRepository().getDeviceManagementService(
- device.getType()).getDeviceManager().getDevice(
- new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
+ Device dmsDevice = this.getDeviceManager(device.getType()).
+ getDevice(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
if (dmsDevice != null) {
device.setFeatures(dmsDevice.getFeatures());
device.setProperties(dmsDevice.getProperties());
@@ -835,10 +832,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
}
for (Device device : allDevices) {
- Device dmsDevice =
- this.getPluginRepository().getDeviceManagementService(
- device.getType()).getDeviceManager().getDevice(
- new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
+ Device dmsDevice = this.getDeviceManager(device.getType()).
+ getDevice(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
if (dmsDevice != null) {
device.setFeatures(dmsDevice.getFeatures());
device.setProperties(dmsDevice.getProperties());
diff --git a/features/oauth-extensions/org.wso2.carbon.oauth.extensions.server.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.oauth.extensions.server.feature/pom.xml
index a20ebb17c6..eae36b42e9 100644
--- a/features/oauth-extensions/org.wso2.carbon.oauth.extensions.server.feature/pom.xml
+++ b/features/oauth-extensions/org.wso2.carbon.oauth.extensions.server.feature/pom.xml
@@ -37,14 +37,6 @@
This feature contains oauth functionality
-
-
-
-
-
-
-
-
@@ -101,8 +93,6 @@
-
-
org.wso2.maven
carbon-p2-plugin
@@ -123,20 +113,6 @@
org.eclipse.equinox.p2.type.group:false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
org.wso2.carbon.core.server:${carbon.kernel.version}
@@ -145,10 +121,6 @@
-
-
-
-