Jedis java.lang.Long cannot be cast to [B
<p><br>
I got "java.lang.ClassCastException: java.lang.Long cannot be cast to [B" while running this code:</p>

<pre><code>JedisPoolConfig config = new JedisPoolConfig();
config.setMaxIdle(10);
config.setMinIdle(1);
config.setMaxWaitMillis(30000);
JedisPool jedisPool = new JedisPool(config, "localhost", 6379);

Jedis jedis = null;
jedis = jedisPool.getResource();

String msisdn = "3331122333";
Long balance = new Long(1000);
int balanceValidity = 30;

Transaction t = jedis.multi();
t.watch(msisdn);
t.set(msisdn, balance.toString());
t.expire(msisdn, balanceValidity);
t.exec();
</code></pre>

<p>Everythings works fine running this code:</p>

<pre><code>Jedis jedis = null;
    try {
        jedis = jedisPool.getResource();

        jedis.watch(msisdn);
        jedis.set(msisdn, balance.toString());      
        jedis.expire(msisdn, balanceValidity);
        jedis.publish("myChannel", msisdn + " " + balance.toString());

    } finally {
        if (jedis != null)
            jedis.close();
    }
</code></pre>

<p>These the used vesions:</p>

<ul>
<li>Redis 3.2.4 </li>
<li>Jedis client 2.9.0 </li>
<li>JDK 1.6</li>
</ul>