【问题标题】:sbt compile fails due to missing constructor Jedis(java.net.URI) in Jedis 2.1.0由于 Jedis 2.1.0 中缺少构造函数 Jedis(java.net.URI),sbt 编译失败
【发布时间】:2013-11-30 20:40:55
【问题描述】:

我的简单项目对 Jedis(Java Redis 库)有一个库依赖:

name := "fit001"

version := "1.0-SNAPSHOT"

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

play.Project.playJavaSettings

我成功运行了play updateplay 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));

我做错了什么?

【问题讨论】:

    标签: playframework sbt playframework-2.1 jedis


    【解决方案1】:

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

    似乎是在 2.2.0 中添加的。

    【讨论】:

      猜你喜欢
      • 2019-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-16
      相关资源
      最近更新 更多