Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 99124200D19 for ; Thu, 21 Sep 2017 14:55:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 97A0C1609D0; Thu, 21 Sep 2017 12:55:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E3D6F1609B8 for ; Thu, 21 Sep 2017 14:55:03 +0200 (CEST) Received: (qmail 79240 invoked by uid 500); 21 Sep 2017 12:55:03 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 79221 invoked by uid 99); 21 Sep 2017 12:55:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Sep 2017 12:55:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8990418E6F4 for ; Thu, 21 Sep 2017 12:55:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id KtMC7jhA89w4 for ; Thu, 21 Sep 2017 12:55:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 2A5DC5FCC1 for ; Thu, 21 Sep 2017 12:55:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id AC99CE09A5 for ; Thu, 21 Sep 2017 12:55:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6611123E7B for ; Thu, 21 Sep 2017 12:55:00 +0000 (UTC) Date: Thu, 21 Sep 2017 12:55:00 +0000 (UTC) From: "Aled Sage (JIRA)" To: dev@brooklyn.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (BROOKLYN-538) IllegalArgumentException parsing (null?) json response in http feed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 21 Sep 2017 12:55:04 -0000 [ https://issues.apache.org/jira/browse/BROOKLYN-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aled Sage resolved BROOKLYN-538. -------------------------------- Resolution: Won't Fix Assignee: Aled Sage Marking this as "won't fix" for the following reasons: * The exception is benign - the sensor gets the expected value of {{null}} * The exception happens deep within the {{JsonPath}} library - it might well be the right behaviour for it to fail if you ask for path {{$}} on a null object. * Working around it in Brooklyn code would be added complexity for no real benefit. > IllegalArgumentException parsing (null?) json response in http feed > ------------------------------------------------------------------- > > Key: BROOKLYN-538 > URL: https://issues.apache.org/jira/browse/BROOKLYN-538 > Project: Brooklyn > Issue Type: Bug > Reporter: Aled Sage > Assignee: Aled Sage > Priority: Minor > > I found this exception in my log (using bleeding edge 0.12.0-SNAPSHOT): > {noformat} > 2017-09-20T14:44:22,427 WARN 122 o.a.b.c.f.AttributePollHandler [ger-H3hclarI-321] unable to compute VanillaSoftwareProcessImpl{id=s588wsizik}->Sensor: planeId (java.lang.String); on val=HttpToolResponse{responseCode=200} > java.lang.IllegalArgumentException: json can not be null > at com.jayway.jsonpath.internal.Utils.notNull(Utils.java:316) [71:com.jayway.jsonpath.json-path:2.4.0] > at com.jayway.jsonpath.internal.JsonContext.(JsonContext.java:47) [71:com.jayway.jsonpath.json-path:2.4.0] > at com.jayway.jsonpath.internal.ParseContextImpl.parse(ParseContextImpl.java:38) [71:com.jayway.jsonpath.json-path:2.4.0] > at com.jayway.jsonpath.JsonPath.read(JsonPath.java:502) [71:com.jayway.jsonpath.json-path:2.4.0] > at org.apache.brooklyn.feed.http.JsonFunctions$GetPath.apply(JsonFunctions.java:320) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.feed.http.JsonFunctions$GetPath.apply(JsonFunctions.java:310) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at com.google.common.base.Functions$FunctionComposition.apply(Functions.java:216) [66:com.google.guava:18.0.0] > at org.apache.brooklyn.core.feed.AttributePollHandler.transformValueOnSuccess(AttributePollHandler.java:114) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.core.feed.AttributePollHandler.onSuccess(AttributePollHandler.java:101) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.core.feed.DelegatingPollHandler.onSuccess(DelegatingPollHandler.java:51) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.core.feed.Poller$PollJob$1.run(Poller.java:79) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.core.feed.Poller$1$1.call(Poller.java:160) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.core.feed.Poller$1$1.call(Poller.java:153) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:363) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.util.core.task.BasicExecutionManager$ScheduledTaskCallable$1.call(BasicExecutionManager.java:451) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:529) [122:org.apache.brooklyn.core:0.12.0.SNAPSHOT] > at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?] > at java.lang.Thread.run(Thread.java:748) [?:?] > {noformat} > I presume it came from this http feed: > {noformat} > - type: org.apache.brooklyn.core.sensor.http.HttpRequestSensor > brooklyn.config: > name: planeId > period: 5s > jsonPath: "$" > uri: > $brooklyn:formatString: > - "%s/v1/server/planeid" > - $brooklyn:attributeWhenReady("main.uri.public") > {noformat} > My guess is that the api returned {{null}}, but I've not yet tried writing a unit test to reproduce. > I'd have expected this to return the json value of {{null}} if that's what the value is. -- This message was sent by Atlassian JIRA (v6.4.14#64029)