gpt4 book ai didi

scala - 错误:java.lang.NoSuchMethodError:com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;

转载 作者:行者123 更新时间:2023-12-03 00:10:02 24 4
gpt4 key购买 nike

我得到错误,就像标题一样。我已经在研究,并且发现了一些类似的东西,但是对我不起作用。

  • NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor conflits on Elastic Search jar
  • Java elasticsearch client always null
  • https://github.com/elastic/elasticsearch/pull/7593
  • java.lang.NoSuchMethodError during Elastic search start
  • https://discuss.elastic.co/t/transportclient-in-2-1-x/38818/6

  • 我使用Scala作为创建API的编程语言,并使用Elasticsearch作为数据库。

    这是我的代码 build.sbt
    name := "LearningByDoing"

    version := "1.0"

    scalaVersion := "2.10.5"

    resolvers += "spray repo" at "http://repo.spray.io"
    resolvers += "spray nightlies repo" at "http://nightlies.spray.io"

    libraryDependencies += "io.spray" % "spray-json_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-can_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-client_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-testkit_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-routing_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-http_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-httpx_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-util_2.10" % "1.3.2"
    libraryDependencies += "io.spray" % "spray-can_2.10" % "1.3.2"

    libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.12"
    libraryDependencies += "org.elasticsearch" % "elasticsearch" % "2.3.1"
    libraryDependencies += "com.sksamuel.elastic4s" % "elastic4s-streams_2.10" % "2.3.1"
    libraryDependencies += "org.elasticsearch" % "elasticsearch-mapper-attachments" % "2.3.1"
    libraryDependencies += "com.typesafe" % "config" % "1.2.1"
    libraryDependencies += "com.typesafe.akka" % "akka-actor_2.10" % "2.3.1"

    这是我的代码 plugins.sbt
    addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0")
    addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-M4")
    addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.9")
    addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")

    在终端上,我被写成 sbt clean编译测试更新包,一切正常。但是当我点击API时,总会出现这样的错误。

    最佳答案

    好像您使用了错误的 Guava 版本,就像您提到的firs link一样,可能是使用this sbt插件,您可以看到依赖关系树并弄清楚了一些混乱的依赖关系。

    关于scala - 错误:java.lang.NoSuchMethodError:com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41622210/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com