类路径

时间:2017-09-21 11:57:45

标签: scala apache-spark intellij-idea compiler-errors

快速帮助解决这个问题。在编译期间,我得到以下一组错误;

Error:(38, 21) Symbol 'type shapeless.HListerAux' is missing from the classpath.
This symbol is required by 'value spray.routing.directives.ParamDefMagnet2.hla'.
Make sure that type HListerAux is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.
          parameter('id) { id =>

Error:(38, 21) Symbol 'type shapeless.Poly.Case2' is missing from the classpath.
This symbol is required by 'method spray.routing.directives.ParamDefMagnet2.MapReduce.from'.
Make sure that type Case2 is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.Poly.
          parameter('id) { id =>

Error:(38, 21) Symbol 'type shapeless.PrependAux' is missing from the classpath.
This symbol is required by 'value spray.routing.directives.ParamDefMagnet2.MapReduce.ev'.
Make sure that type PrependAux is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.
          parameter('id) { id =>

Error:(38, 21) Symbol 'type shapeless.HListerAux' is missing from the classpath.
This symbol is required by 'value spray.routing.directives.ParamDefMagnet2.hla'.
Make sure that type HListerAux is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.
          parameter('id) { id =>

虽然,总的来说,问题在于“无形”,我已经将其作为依赖项(包括解析器)包含在库中,

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  Resolver.sonatypeRepo("snapshots")
)

libraryDependencies ++= Seq(
  "com.chuusai" %% "shapeless" % "2.3.2"
) 

我希望得到一个合适的建议作为修复。

1 个答案:

答案 0 :(得分:3)

我知道如何解决它,我以前遇到过这个问题。 这是版本的问题,请仔细阅读以下内容,您将解决此问题。

无形版本 如果你想在你的应用程序中使用无形和喷雾路由,你需要选择针对你想要使用的无形释放构建的喷雾版本(-routing)。 对于无形1.2.4,应使用喷雾1.1.4,1.2.4或1.3.4以及喷雾路径模块。 不再支持shapeless 2.0.0。 对于无形2.3.0,您应该使用喷涂1.3.4(Scala 2.10或Scala 2.11)和喷涂路径无形23模块而不是喷涂路径

libraryDependencies ++= "io.spray" %% "spray-routing-shapeless23" % "1.3.4",