Cannot read Redis response as a byte array

java.lang.ClassCastException
Javadoc
Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. For example, the following code generates a ClassCastException:
    Object x = new Integer(0);
    System.out.println((String)x);
@author unascribed @since JDK1.0
at redis.clients.jedis.BuilderFactory$5.build
(Source)

Typical Exception Messages

  1. java.util.ArrayList cannot be cast to [B
  2. java.lang.Long cannot be cast to [B

Specific cases

Solutions

  1. zsamboki, 1 month ago

    You should update Jedis to a newer version (3.0.0+)

We have seen this error pattern in the following webpages (9)

  1. hcadavidvia GitHub7 months ago
  2. Adityanarayan Vaidyavia Google Groups1 year ago
  3. Jennifer Hickeyvia Spring JIRA1 year ago
    java.util.ArrayList cannot be cast to [B
  4. Jennifer Hickeyvia Spring JIRA2 years ago
    java.util.ArrayList cannot be cast to [B
  5. for5millionvia GitHub2 years ago
    java.util.ArrayList cannot be cast to [B
  6. DbxDevvia GitHub2 years ago
  7. raghavamvia GitHub2 years ago
    java.util.ArrayList cannot be cast to [B
  8. psydellvia GitHub2 years ago
    java.util.ArrayList cannot be cast to [B