首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >与用于SprayJsonSupport的Akka Http Spray一起使用时,类路径中缺少“'term akka.stream”

与用于SprayJsonSupport的Akka Http Spray一起使用时,类路径中缺少“'term akka.stream”
EN

Stack Overflow用户
提问于 2018-08-29 20:51:48
回答 1查看 1.2K关注 0票数 2

我在我的项目中使用了akka-http和reactivemongo,并使用了akka-http-spray json编组/解组case类。下面是它们的依赖关系:

代码语言:javascript
复制
"com.typesafe.akka" %% "akka-http" % "10.1.3"
"com.typesafe.akka" %% "akka-stream" % "2.5.14"
"com.typesafe.akka" %% "akka-http-spray-json" % "10.1.3"
"org.reactivemongo" %% "reactivemongo" % "0.16.0"

我的代码在另一个我没有使用reactivemongo的项目中运行良好。但现在我得到了一个错误-

代码语言:javascript
复制
[error] /home/ficode/project/ficode-sentinll/sentinll-common/src/main/scala/ficode/sentinll/common/model/CategoryManagement.scala:32:69: Symbol 'term akka.stream' is missing from the classpath.
[error] This symbol is required by 'method akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonSourceReader'.
[error] Make sure that term stream is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
[error] A full rebuild may help if 'SprayJsonSupport.class' was compiled against an incompatible version of akka.
[error]   implicit val requestHeaderFormat = jsonFormat1(RequestHeader)
[error]                                                                     ^
[error] one error found

我还收到了关于reactivemongo和akka-stream中版本冲突的警告。

代码语言:javascript
复制
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * com.typesafe.akka:akka-actor_2.11:2.5.14 is selected over 2.3.13
[warn]      +- com.typesafe.akka:akka-stream_2.11:2.5.14 ()       (depends on 2.5.14)
[warn]      +- org.reactivemongo:reactivemongo_2.11:0.16.0 ()     (depends on 2.3.13)
[warn] Run 'evicted' to see detailed eviction warnings

我试图从reactivemongo中排除akka依赖项。警告消失了,但错误没有消失。

你知道我该怎么解决这个问题吗?提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2018-08-30 10:48:24

是否尝试在SBT中添加覆盖?

代码语言:javascript
复制
dependencyOverrides ++= Set("com.typesafe.akka" % "akka-http-spray-json" % "10.1.3")
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52077952

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档