[ 
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.<init>(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)

Reply via email to