0

我的简单项目依赖于 Jedis(Java Redis 库):

name := "fit001"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  "redis.clients" % "jedis" % "2.1.0"
)

play.Project.playJavaSettings

我都跑了play update,而且play dependencies成功了。

Here are the resolved dependencies of your application:

+-------------------------------------------------------------------+--------------------------------------------------------+------------------------------+
| Module                                                            | Required by                                            | Note                         |
+-------------------------------------------------------------------+--------------------------------------------------------+------------------------------+
| redis.clients:jedis:2.1.0                                         | default:fit001_2.10:1.0-SNAPSHOT                       | As jedis-2.1.0.jar           |
+-------------------------------------------------------------------+--------------------------------------------------------+------------------------------+
| commons-pool:commons-pool:1.5.5                                   | redis.clients:jedis:2.1.0                              | As commons-pool-1.5.5.jar    |
+-------------------------------------------------------------------+--------------------------------------------------------+------------------------------+
| com.typesafe.play:play-cache_2.10:2.2.0                           | default:fit001_2.10:1.0-SNAPSHOT                       | As play-cache_2.10.jar       |

但是当我执行时sbt compile,它会报告以下问题:

[error] /Users/jkwok/Personal/play/fit001/app/com/games/leaderboard/Leaderboard.java:49: cannot find symbol
[error] symbol  : constructor Jedis(java.net.URI)
[error] location: class redis.clients.jedis.Jedis
[error]         this(leaderboardName, pageSize, new Jedis(uri));

我究竟做错了什么?

4

1 回答 1

2

您选择的库版本似乎没有该构造函数。 https://github.com/xetorthio/jedis/blob/jedis-2.1.0/src/main/java/redis/clients/jedis/Jedis.java

它似乎已在 2.2.0 中添加。

于 2013-11-18T00:51:02.840 回答