From f551a88d2e99f966533190c0cd6ae9fa61f450f3 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Mon, 29 Jan 2018 10:12:51 +0530 Subject: [PATCH 1/2] Fixing the error in event publishing This is error occurrs when the event publishing cause and error, it does not print any log. --- .../android/services/impl/EventReceiverServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java index b7c9ac156..66f411352 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java @@ -106,9 +106,12 @@ public class EventReceiverServiceImpl implements EventReceiverService { message.setResponseCode("Event is published successfully."); return Response.status(Response.Status.CREATED).entity(message).build(); } else { + log.warn("Error occurred while trying to publish the event. This could be due to unavailability " + + "of the publishing service. Please make sure that analytics server is running and accessible by " + + "this server"); throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage("Error occurred while " + - "publishing the event.").build()); + new ErrorResponse.ErrorResponseBuilder().setCode(503l).setMessage("Error occurred due to " + + "unavailability of the publishing service.").build()); } } catch (DataPublisherConfigurationException e) { String msg = "Error occurred while getting the Data publisher Service instance."; From 6882a560bcf136cad07b197d1e9efbe79ad06f5a Mon Sep 17 00:00:00 2001 From: geethkokila Date: Mon, 29 Jan 2018 10:20:43 +0530 Subject: [PATCH 2/2] Fixing the error in event publishing This is error occurrs when the event publishing cause and error, it does not print any log. --- .../android/services/impl/EventReceiverServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java index 66f411352..c5e0c36ab 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java @@ -107,8 +107,8 @@ public class EventReceiverServiceImpl implements EventReceiverService { return Response.status(Response.Status.CREATED).entity(message).build(); } else { log.warn("Error occurred while trying to publish the event. This could be due to unavailability " + - "of the publishing service. Please make sure that analytics server is running and accessible by " + - "this server"); + "of the publishing service. Please make sure that analytics server is running and accessible " + + "by this server"); throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(503l).setMessage("Error occurred due to " + "unavailability of the publishing service.").build());