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

Parsing JSON cache config changes format of cache name value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 15.1.0.Dev05
    • 15.0.8.Final
    • Configuration
    • None

      The following will result in a NPE as the cache is stored with the name action-tokens, when it should be actionTokens:

      String configJson = "{\n" +
                        "    \"actionTokens\": {\n" +
                        "        \"distributed-cache\": {\n" +
                        "            \"owners\": \"2\",\n" +
                        "            \"mode\": \"SYNC\",\n" +
                        "            \"encoding\": {\n" +
                        "                \"key\": {\n" +
                        "                    \"media-type\": \"application/x-java-object\"\n" +
                        "                },\n" +
                        "                \"value\": {\n" +
                        "                    \"media-type\": \"application/x-java-object\"\n" +
                        "                }\n" +
                        "            },\n" +
                        "            \"expiration\": {\n" +
                        "                \"lifespan\": \"-1\",\n" +
                        "                \"max-idle\": \"-1\",\n" +
                        "                \"interval\": \"300000\"\n" +
                        "            },\n" +
                        "            \"memory\": {\n" +
                        "                \"max-count\": \"100\"\n" +
                        "            }\n" +
                        "        }\n" +
                        "    }\n" +
                        "}";
      
      ConfigurationBuilderHolder configHolder = parserRegistry.parse(configJson, MediaType.APPLICATION_JSON);
      Configuration config = configHolder.getNamedConfigurationBuilders().get(cacheName).build();
      

              ttarrant@redhat.com Tristan Tarrant
              remerson@redhat.com Ryan Emerson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: