Uploaded image for project: 'Hawkular Metrics'
  1. Hawkular Metrics
  2. HWKMETRICS-427

JsonGenerationException: Current context not an object but ROOT

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 0.17.0
    • Component/s: REST
    • Labels:
      None

      Description

      I am updating the Grafana datasource plugin to use the new endpoints introduced in HWKMETRICS-393.

      The requests now go through the Grafana proxy. But the server response are empty. In the server logs, I see this warning

      12:49:25,365 WARN  [org.hawkular.metrics.api.jaxrs.handler.observer.NamedDataPointObserver] (RxCachedThreadScheduler-3) Error while finishing streaming data: com.fasterxml.jackson.core.JsonGenerationException: Current context not an object but ROOT
      	at com.fasterxml.jackson.core.JsonGenerator._reportError(JsonGenerator.java:1574)
      	at com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeEndObject(UTF8JsonGenerator.java:326)
      	at org.hawkular.metrics.api.jaxrs.handler.observer.NamedDataPointObserver.onCompleted(NamedDataPointObserver.java:151)
      	at rx.observers.SafeSubscriber.onCompleted(SafeSubscriber.java:81)
      	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:201)
      	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:170)
      	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      It looks like it happens only when there is no data for the query.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tsegismont Thomas Segismont
                  Reporter:
                  tsegismont Thomas Segismont
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: