From f808478c92ddfe9e5142ec182bfbbd716bd61936 Mon Sep 17 00:00:00 2001 From: Megala Date: Wed, 7 Dec 2016 15:29:32 +0530 Subject: [PATCH] Fixing bundle loading problem --- .../org.wso2.extension.siddhi.execution.json/pom.xml | 1 + .../execution/json/getPropertyFunctionExtension.java | 12 ++++++++---- .../pom.xml | 1 - pom.xml | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml index b14a66967b..b1671cc446 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml @@ -47,6 +47,7 @@ org.json.wso2 json + ${analytics.json.version} junit diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/src/main/java/org/wso2/extension/siddhi/execution/json/getPropertyFunctionExtension.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/src/main/java/org/wso2/extension/siddhi/execution/json/getPropertyFunctionExtension.java index 78c873a550..8f68577a60 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/src/main/java/org/wso2/extension/siddhi/execution/json/getPropertyFunctionExtension.java +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/src/main/java/org/wso2/extension/siddhi/execution/json/getPropertyFunctionExtension.java @@ -18,6 +18,7 @@ package org.wso2.extension.siddhi.execution.json; +import org.json.JSONException; import org.json.JSONObject; import org.wso2.siddhi.core.config.ExecutionPlanContext; import org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException; @@ -68,10 +69,13 @@ public class getPropertyFunctionExtension extends FunctionExecutor { } String jsonString = (String) data[0]; String property = (String) data[1]; - - JSONObject jsonObject = new JSONObject(jsonString); - Object value = jsonObject.get(property).toString(); - return value; + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonString); + return jsonObject.get(property).toString(); + } catch (JSONException e) { + throw new ExecutionPlanRuntimeException("Cannot parse JSON String in json:getPeroperty() function. " + e); + } } @Override diff --git a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml index 5c572f2c26..09380ecf42 100644 --- a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml +++ b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml @@ -65,7 +65,6 @@ org.wso2.carbon.devicemgt-plugins:org.wso2.extension.siddhi.execution.json:${carbon.devicemgt.plugins.version} - org.json.wso2:json:${commons-json.version} diff --git a/pom.xml b/pom.xml index e2d044ccee..f6181f3235 100644 --- a/pom.xml +++ b/pom.xml @@ -856,7 +856,6 @@ gcm-server ${gcm.server.version} - org.json.wso2 json @@ -1377,6 +1376,7 @@ 1.7 3.1.2 1.7.2 + 2.0.0.wso2v1