Cannot read Redis bulk reply as a Long

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.Connection.getIntegerReply
(source)

Typical Exception Messages

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

Solution

zsamboki, 2 months ago

You should not use the client from multiple threads at the same time. Check out: https://github.com/xetorthio/jedis/wiki/Getting-started#using-jedis-in-a-multithreaded-environment

External results for this pattern (14)

  1. SBoylevia Google Groups7 hours ago
    [B cannot be cast to java.lang.Long
    Show stack trace
  2. Unknown authorvia techforumnetwork.com9 hours ago
    java.util.ArrayList cannot be cast to java.lang.Long
    Show stack trace
  3. nykolaslimavia GitHub3 days ago
    [B cannot be cast to java.lang.Long
    Show stack trace
  4. ruanjfvia GitHub1 year ago
    [B cannot be cast to java.lang.Long
    Show stack trace
  5. zhenguangvia GitHub1 year ago
    java.util.ArrayList cannot be cast to java.lang.Long
    Show stack trace
  6. inponomarevvia GitHub1 year ago
    [B cannot be cast to java.lang.Long
    Show stack trace
  7. Bam4dvia GitHub1 year ago
    java.util.ArrayList cannot be cast to java.lang.Long
    Show stack trace
  8. Unknown authorvia spring.io2 years ago
    java.util.ArrayList cannot be cast to java.lang.Long
    Show stack trace
  9. m8r-ubnc5gvia GitHub2 years ago
    [B cannot be cast to java.lang.Long
    Show stack trace