title: Jedis SpringBoot cannot serialize and deserialize Map<String, Object>
body: <p>I got following error after adding @Cacheable annotation to one of my rest method: </p>
  
  <pre><code>"status": 500,
  "error": "Internal Server Error",
  "message": "class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')",
  </code></pre>
  
  <p>Method declaration is:</p>
  
  <pre><code>@Cacheable("loadDevicesFloors")
  @GetMapping("/floors/all-devices")
  public Map&lt;String, DevicesFloorDTO&gt; loadDevicesFloors() {...
  </code></pre>
  
  <p>and DevicesFloorDTO looks as follows:</p>
  
  <pre><code>public class DevicesFloorDTO implements Serializable {
      private final List&lt;DeviceDTO&gt; deviceDTOs;
      private final String floorName;
      private final Integer floorIndex;
      public DevicesFloorDTO(List&lt;DeviceDTO&gt; devicesDtos, String floorName, Integer floorIndex) {
          this.deviceDTOs = devicesDtos;
          this.floorName = floorName;
          this.floorIndex = floorIndex;
      }...
  </code></pre>
  
  <p>Additionally my @Bean redisTemplate method implementation:</p>
  
  <pre><code>@Bean
      JedisConnectionFactory jedisConnectionFactory() {
          JedisConnectionFactory jedisConFactory
                  = new JedisConnectionFactory();
          jedisConFactory.setHostName(redisHost);
          jedisConFactory.setPort(redisPort);
          jedisConFactory.setPassword(redisPassword);
          return jedisConFactory;
      }
  
  @Bean
      public RedisTemplate&lt;?, ?&gt; redisTemplate() {
          RedisTemplate&lt;byte[], byte[]&gt; template = new RedisTemplate&lt;&gt;();
          template.setConnectionFactory(jedisConnectionFactory());
          return template;
      }
  </code></pre>
  
  <p>Does anyone know what is wrong in this implementation? Without @Cacheable it works as expected, but after adding @Cacheable error occurs. I was searching a lot and still don't know what causes this error and how to fix this. Any comment may be helpful. Thaks a lot!</p>