';术语akka.stream';与Akka Http Spray Json一起用于SprayJsonSupport时,类路径中缺少

';术语akka.stream';与Akka Http Spray Json一起用于SprayJsonSupport时,类路径中缺少,akka,akka-stream,akka-http,spray-json,Akka,Akka Stream,Akka Http,Spray Json,我在我的项目中使用akka http和reactivemongo,并使用akka http json对案例类进行编组/解组。以下是它们的依赖关系- "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" %% "r

我在我的项目中使用akka http和reactivemongo,并使用akka http json对案例类进行编组/解组。以下是它们的依赖关系-

"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的项目中运行良好。但现在我犯了一个错误-

[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中版本冲突的警告-

[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依赖项。警告消失了,但错误没有消失


你知道我该怎么解决吗?提前感谢。

是否尝试在SBT中添加覆盖

dependencyOverrides ++= Set("com.typesafe.akka" % "akka-http-spray-json" % "10.1.3")

ReactiveMongo与akka从2.3到2.5(由测试覆盖)兼容,因此警告表示没有问题(只是表示最低版本被支持的较新版本覆盖)。