我正在尝试使用兔子mq客户端运行akka-http (‘_2.12’)
使用scala版本2.12。
但我有个例外:
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Function1$class
at akka.http.scaladsl.server.PathMatcher.<init>(PathMatcher.scala:20)
at akka.http.scaladsl.server.ImplicitPathMatcherConstruction$$anon$8.<init>(PathMatcher.scala:267)
at akka.http.scaladsl.server.ImplicitPathMatcherConstruction$class._regex2PathMatcher(PathMatcher.scala:267)
at akka.http.scaladsl.server.PathMatcher$._regex2PathMatcher(PathMatcher.scala:105)
at
akka.http.scaladsl.server.PathMatchers$class.$init$(PathMatcher.scala:461)
at akka.http.scaladsl.server.Directives$.<init>(Directives.scala:40)
at akka.http.scaladsl.server.Directives$.<clinit>(Directives.scala)
at WebServer$.main(WebServer.scala:41)
at WebServer.main(WebServer.scala)
Caused by: java.lang.ClassNotFoundException: scala.Function1$class
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)我想这是因为版本冲突,因为当禁用rmq时,它可以工作。
您能帮助或建议其他rmq库将工作谢谢!
发布于 2017-04-30 13:11:44
您使用的是用Scala2.11编译的akka-http (akka-http-core_2.11),但是您的RMQ驱动程序是2.12。您需要决定使用的Scala的哪个版本,然后使用使用该版本编译的驱动程序。如果您决定使用Scala2.12,则需要akka-http-core_2.12。
https://stackoverflow.com/questions/43706361
复制相似问题