From 56f864a3f5128f68b29154ed2efd6185fe0f51fd Mon Sep 17 00:00:00 2001 From: tcdlpds Date: Wed, 31 Jul 2024 00:35:02 +0530 Subject: [PATCH] Fix server starting issue --- .../pom.xml | 1 + .../webapp/publisher/APIPublisherServiceImpl.java | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml index d5663f5433..b211a15d26 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml @@ -180,6 +180,7 @@ io.entgra.device.mgt.core.apimgt.webapp.publisher.dto, io.entgra.device.mgt.core.apimgt.webapp.publisher.exception, io.entgra.device.mgt.core.device.mgt.common.exceptions, + io.entgra.device.mgt.core.device.mgt.common.permission.mgt, io.entgra.device.mgt.core.device.mgt.common.metadata.mgt, io.entgra.device.mgt.core.device.mgt.core.config, io.entgra.device.mgt.core.device.mgt.core.config.permission, diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java index aebdde8967..c3e5a6bc54 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -68,8 +68,6 @@ import org.wso2.carbon.user.core.tenant.Tenant; import org.wso2.carbon.user.core.tenant.TenantSearchResult; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; import java.io.BufferedReader; @@ -79,7 +77,15 @@ import java.io.IOException; import java.nio.file.DirectoryIteratorException; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * This class represents the concrete implementation of the APIPublisherService that corresponds to providing all @@ -599,7 +605,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { // add permission if not exist try { PermissionUtils.putPermission(permission); - } catch(PermissionManagementException e) { + } catch (PermissionManagementException e) { log.error("Error when adding permission ", e); } }