ambiguous implicit values in scala-redis connector

173 views Asked by At

I am trying to use Scala-Redis connector. Here is the code to establish connection.

object RedisConnection extends Serializable {
            lazy val r: RedisClient = new RedisClient("localhost", 6379,5)
         }

I defined the connection this way because I was getting "task not serialisable error". When I did println(RedisConnection.r.get("microcin b17")) , I got the following error, when trying to do sbt assembly

ambiguous implicit values:
[error]  both value parseString in object Implicits of type => com.redis.serialization.Parse[String]
[error]  and value parseByteArray in object Implicits of type => com.redis.serialization.Parse[Array[Byte]]
[error]  match expected type com.redis.serialization.Parse[A]

Any help would be appreciated. Thanks.

1

There are 1 answers

0
mavarazy On BEST ANSWER

Specifying exactly the type you want

r.get[String]("microcin b17")