本文介绍了sbt编译由于缺少Jedis 2.1.0中的构造函数Jedis(java.net.URI)而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My simple project has a library dependency on Jedis (the Java Redis library):

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时,它报告以下问题:

But when I execute sbt compile, it reports the following issue:

[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));

我在做什么错了?

推荐答案

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

The version of the library you selected doesn't seem to have that constructor. https://github.com/xetorthio/jedis/blob/jedis-2.1.0/src/main/java/redis/clients/jedis/Jedis.java

它似乎已在2.2.0中添加.

It appears to have been added in 2.2.0.

这篇关于sbt编译由于缺少Jedis 2.1.0中的构造函数Jedis(java.net.URI)而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 14:17