From 856fea3455d46c526d3460a56d7eed132a532c17 Mon Sep 17 00:00:00 2001 From: manoj Date: Fri, 19 Jun 2015 11:37:58 +0530 Subject: [PATCH] fix instansiating of device provider serviceImpl with empty plugin repo --- .../core/internal/DeviceManagementServiceComponent.java | 8 ++++---- .../user/core/internal/DeviceMgtUserServiceComponent.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java index 26c083ff185..61eebebce43 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -130,9 +130,6 @@ public class DeviceManagementServiceComponent { /* Initializing app manager connector */ this.initAppManagerConnector(); - DeviceManagementProviderService deviceManagementProvider = - new DeviceManagementProviderServiceImpl(this.getPluginRepository()); - DeviceManagementDataHolder.getInstance().setDeviceManagementProvider(deviceManagementProvider); OperationManagementDAOFactory.init(dsConfig); /* If -Dsetup option enabled then create device management database schema */ @@ -203,8 +200,11 @@ public class DeviceManagementServiceComponent { } /* Registering Device Management Service */ BundleContext bundleContext = componentContext.getBundleContext(); + DeviceManagementProviderService deviceManagementProvider = + new DeviceManagementProviderServiceImpl(this.getPluginRepository()); + DeviceManagementDataHolder.getInstance().setDeviceManagementProvider(deviceManagementProvider); bundleContext.registerService(DeviceManagementProviderService.class.getName(), - new DeviceManagementProviderServiceImpl(), null); + deviceManagementProvider, null); APIPublisherService publisher = new APIPublisherServiceImpl(); DeviceManagementDataHolder.getInstance().setApiPublisherService(publisher); diff --git a/components/user-mgt/org.wso2.carbon.device.mgt.user.core/src/main/java/org/wso2/carbon/device/mgt/user/core/internal/DeviceMgtUserServiceComponent.java b/components/user-mgt/org.wso2.carbon.device.mgt.user.core/src/main/java/org/wso2/carbon/device/mgt/user/core/internal/DeviceMgtUserServiceComponent.java index bdacc71d8e2..86c92c3be31 100644 --- a/components/user-mgt/org.wso2.carbon.device.mgt.user.core/src/main/java/org/wso2/carbon/device/mgt/user/core/internal/DeviceMgtUserServiceComponent.java +++ b/components/user-mgt/org.wso2.carbon.device.mgt.user.core/src/main/java/org/wso2/carbon/device/mgt/user/core/internal/DeviceMgtUserServiceComponent.java @@ -55,7 +55,7 @@ public class DeviceMgtUserServiceComponent { } /* Registering User Management service */ BundleContext bundleContext = componentContext.getBundleContext(); - bundleContext.registerService(org.wso2.carbon.device.mgt.user.core.UserManager.class, + bundleContext.registerService(org.wso2.carbon.device.mgt.user.core.UserManager.class.getName(), new org.wso2.carbon.device.mgt.user.core.service.UserManagementService(), null); if (log.isDebugEnabled()) { log.debug("User management core bundle has been successfully initialized");