alphazero / jredis

Java Client and Connectors for Redis
http://code.google.com/p/jredis/
Apache License 2.0
315 stars 136 forks source link

Expecting status code for size/count #40

Open aramis102 opened 13 years ago

aramis102 commented 13 years ago

I am experiencing this exception while using the keys() method

-- JREDIS -- BUG: serviceRequest() -- ProviderException: Bug? Expecting status code for size/count -- JREDIS -- INFO: serviceRequest() -- closing connection ... org.jredis.ProviderException: Bug? Expecting status code for size/count at org.jredis.ri.alphazero.protocol.SynchProtocol$SynchMultiLineResponseBase.readControlLine(SynchProtocol.java:410) at org.jredis.ri.alphazero.protocol.SynchProtocol$SynchBulkResponse.read(SynchProtocol.java:488) at org.jredis.ri.alphazero.connection.SynchConnection.serviceRequest(SynchConnection.java:138) at org.jredis.ri.alphazero.JRedisClient.serviceRequest(JRedisClient.java:155) at org.jredis.ri.alphazero.JRedisSupport.keys(JRedisSupport.java:1022) at com.chikka.tron.JredisClient.main(JredisClient.java:83)

JRedis redis = new JRedisClient("localhost", 6379); ... line 83 : redis.keys();

motti commented 13 years ago

You are almost certainly using the wrong jredis version for the redis server you are running. With version v2+ the KEYS command changed its reply type (from bulk to multi-bulk) but most other commands didn't so for the most part an incompatible version of jredis will work but for keys() it won't.