# Metricbeat failed to unmarshal jolokia JSON response

**URL:** <https://discuss.elastic.co/t/metricbeat-failed-to-unmarshal-jolokia-json-response/169433>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [February 21, 2019, 2:26pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-unmarshal-jolokia-json-response/169433 "2019-02-21T14:26:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![souf\_el\_badraoui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souf_el_badraoui/32/47746_2.png) [@souf\_el\_badraoui](https://discuss.elastic.co/u/souf_el_badraoui)\
**Post date:** [February 21, 2019, 2:26pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-unmarshal-jolokia-json-response/169433/1 "2019-02-21T14:26:50Z")

</div>

Hello team!

I am trying to use the Jolokia module of Metricbeat to collect jmx metrics and get this error:

`failed to unmarshal jolokia JSON response '{"request":{"type":"version"},"value":{"agent":"1.6.0","protocol":"7.2","config":{"listenForHttpService":"true","authIgnoreCerts":"false","agentId":"","debug":"false","agentType":"servlet","policyLocation":"classpath:\/jolokia-access.xml","agentContext":"\/jolokia","serializeException":"false","mimeType":"text\/plain","dispatcherClasses":"org.jolokia.http.Jsr160ProxyNotEnabledByDefaultAnymoreDispatcher","authMode":"basic","streaming":"true","canonicalNaming":"true","historyMaxEntries":"10","allowErrorDetails":"true","allowDnsReverseLookup":"true","realm":"jolokia","includeStackTrace":"true","useRestrictorService":"false","debugMaxEntries":"100"},"info":{"product":"tomcat","vendor":"Apache","version":"8.5.6"}},"timestamp":1550758168,"status":200}': json: cannot unmarshal object into Go value of type []jmx.Entry`

I use this metricbeat conf:

```
###################### Metricbeat Configuration Example #######################@
#========================== Modules jolokia configuration ============================
metricbeat.modules:
- module: jolokia
  metricsets: ["jmx"]
  enabled: true
  period: 10s
  namespace: "metrics"
  hosts: ["localhost"]
  http_method: "POST"
  path: "/plugins/servlet/jolokia/"
  #username: ""
  #password: ""
  jmx.mappings:
    - mbean: 'Catalina:type=Manager,host=localhost,context=/'
      attributes:
        - attr: activeSessions
          field: activeSessions  
    - mbean: 'Catalina:type=ThreadPool,name="http-nio8090"'
      attributes:
        - attr: connectionCount
          field: connectionCount 
    - mbean: 'java.lang:type=Memory'
      attributes:
        - attr: HeapMemoryUsage.max
          field: heapMemoryUsageMax 
    - mbean: 'java.lang:type=Memory'
      attributes:
        - attr: HeapMemoryUsage.used
          field: heapMemoryUsed 
setup.template.settings:
  index:
    number_of_shards: 1,
    number_of_replicas: 0,
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  hosts: ["elastic:9200"]
  #username: "elastic"
  #password: "vaudoise"

```

We are using metricbeat-6.2.4 and also a 6.2.4 elasticsearch.  
Thx for your help !!!

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [February 21, 2019, 9:14pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-unmarshal-jolokia-json-response/169433/2 "2019-02-21T21:14:54Z")

</div>

Hello! I think this is probably a bug in the code hmm Can you file an issue with more details in github repo please [https://github.com/elastic/beats/issues](https://github.com/elastic/beats/issues) ? Thank you!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 21, 2019, 9:15pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-unmarshal-jolokia-json-response/169433/3 "2019-03-21T21:15:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
