Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12791

The console cannot display data converted to JSON

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Undefined

      Given a cache configured to store POJOs:

      <encoding media-type="application/x-java-object"/>

      where the jars are present in the server lib/ dir, and the server is started to allow all deserialization:

      -Dinfinispan.deserialization.allowlist.regexps=".*"

      the console cannot display the entries as JSON. This is a sample output from the REST getEntries method:

      [
        {
          "key": 3,
          "value": {
            "_type": "org.infinispan.simple.Person",
            "name": "donald",
            "age": 78
          },
          "timeToLiveSeconds": -1,
          "maxIdleTimeSeconds": -1,
          "created": -1,
          "lastUsed": -1,
          "expireTime": -1
        },
        {
          "key": 1,
          "value": {
            "_type": "org.infinispan.simple.Person",
            "name": "kim",
            "age": 67
          },
          "timeToLiveSeconds": -1,
          "maxIdleTimeSeconds": -1,
          "created": -1,
          "lastUsed": -1,
          "expireTime": -1
        },
        {
          "key": 2,
          "value": {
            "_type": "org.infinispan.simple.Person",
            "name": "joe",
            "age": 48
          },
          "timeToLiveSeconds": -1,
          "maxIdleTimeSeconds": -1,
          "created": -1,
          "lastUsed": -1,
          "expireTime": -1
        }
      ]
      

      The console cannot display this JSON showing an error:

      Something went wrong
      Error: Expected `string` for value, got `[object Object]`

              karestig@redhat.com Katia Aresti
              gfernand@redhat.com Gustavo Fernandes (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: