- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
View repository at this specific commit here
我正在组建一个小型 SBT 项目并学习如何使用 akka actor。我能够得到一个仅使用 akka 的简单示例,但是一旦我使用外部库,事情就会停止工作。我用这个得到了一个非常大的堆栈跟踪
objc[15196]: Class JavaLaunchHelper is implemented in both
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java (0x10cc6c4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10ccf84e0). One of the two will be used. Which one is undefined.
Detected java.lang.NoSuchMethodError error, which MAY be caused by incompatible Akka versions on the classpath. Please note that a given Akka version MUST be the same across all modules of Akka that you are using, e.g. if you use akka-actor [2.5.8 (resolved from current classpath)] all other core Akka modules MUST be of the same version. External projects like Alpakka, Persistence plugins or Akka HTTP etc. have their own version numbers - please make sure you're using a compatible set of libraries.
Uncaught error from thread [HelloSystem-akka.actor.default-dispatcher-4]: akka.actor.ActorCell.addFunctionRef(Lscala/Function2;)Lakka/actor/FunctionRef;, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[HelloSystem]
java.lang.NoSuchMethodError: akka.actor.ActorCell.addFunctionRef(Lscala/Function2;)Lakka/actor/FunctionRef;
我的依赖项如下所示:
object v {
val akka = "2.5.8"
val scrape = "0.4.0"
}
val akka = Seq(
"com.typesafe.akka" %% "akka-actor" % v.akka,
"com.typesafe.akka" %% "akka-slf4j" % v.akka
)
val scrape = Seq(
"io.bfil" %% "scalescrape" % v.scrape
)
lazy val allDeps = akka ++ scrape
我正在使用this library也使用 akka 版本 5.8
那么有什么好处呢?这个矛盾的 akka actor 版本是从哪里来的?这是我的 build.sbt
,其中包括我尝试使用的冲突管理器:
import Dependencies._
name := "sputnik-scraper"
version := "0.1"
scalaVersion := "2.12.4"
conflictManager := ConflictManager.strict
dependencyOverrides += "com.typesafe.akka" %% "akka-actor" % "2.5.8"
lazy val root = (project in file(".")).settings(
libraryDependencies ++= allDeps
)
编辑:添加了 main 中的代码。
import akka.actor.{ActorSystem, Props}
import io.bfil.scalescrape.actor.ScrapingActor
object Main extends App {
val system = ActorSystem("HelloSystem")
// default Actor constructor
val helloActor = system.actorOf(Props[ExampleScraper], name = "helloactor")
helloActor ! "hello"
helloActor ! "buenos dias"
}
class ExampleScraper extends ScrapingActor {
private val baseUrl = "https://www.sputnikmusic.com/"
override def receive: Receive = {
case _ => grabMainTitle(baseUrl)
}
private def grabMainTitle(url: String) =
scrape {
get(url) { response =>
complete(doIt(response))
}
}
private def doIt(response: Any): Unit = {
println(response)
}
}
最佳答案
很有可能是由 scalescrape 中使用的 Akka-HTTP 版本 10.0.1 引起的与 Akka 2.5 不同步。这是最新版本 Akka-HTTP 10.0.5 的发行说明:
This is the fifth maintenance release of the Akka HTTP 10.0 series. It is primarily aimed at stability aligning the internals with the upcoming Akka 2.5 release. ...
您可能需要考虑将 Akka-HTTP 依赖项修改为更新版本的 Akka HTTP 10.0。目前最新版本是 10.0.11。
关于Scala 声称我正在使用不同版本的 Akka,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48363010/
我正在尝试解决为什么 Ruby 没有用空格分割我的字符串。例如: [1] pry(#)> msg => "!iex [email protected]|[email protected]> Firs
我正在尝试解决为什么 Ruby 没有用空格分割我的字符串。例如: [1] pry(#)> msg => "!iex [email protected]|[email protected]> Firs
这是我的 API 端点: [HttpPost] public int Post(SearchHistory searchHistory) { IDashboardRepository dash
我正在按照these guidelines验证来自Facebook API的signed_request参数。 ,但我在调用 Commons Codec 中的 Base64 类的某些方法时遇到了问题。
我有一个 json 结构数组: { data : [ { "num" : val , "time" : val } , ... ] } 我需要找到 num 的最大值和最短/最长时间,以及将对象移动到
我使用 Xcode 的 Refactor > Rename 命令尝试重命名 C 中的方法参数 this。 它声称 this 是“保留语言关键字”,但据我所知,事实并非如此。 这是 Xcode 中的错误
有人刚刚给我看了 A byte of Python 的旧 PDF 版本.根据本身,它是 3.0 版(本书的,而不是 Python 的),从 2014 年开始。在 Operators 部分, 有一个部分
问题: 您在 Intellij 中使用 VCS 系统并尝试提交内容。提交失败,Intellij 声称 index.lock 存在。你检查你的 repo 目录中的 .git/index.lock,发现它
我有以下 SAM 模板: AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Descriptio
这可能看起来微不足道,但我使用 Excel 来操作程序中的一些数据,然后以 tsv 格式输出数据。我想用 gnuplot 来绘制它,其复杂性不比 plot "filename" 复杂,但 gnuplo
我正在使用嵌入式 Jetty 启动标准 Java 网络应用程序。我的启动器是这样的: import org.eclipse.jetty.server.Server; import org.eclips
我正在阅读 Joshua Bloch 的 Effective Java,第 2 版,第 11 条:明智地覆盖克隆。 在第 56 页,他试图解释当我们重写某些类(如集合类)的 clone() 时,我们必
问题: 如 Fusion Location Provider API 所声称的,位置更新在室内不起作用。 发生了什么: 我尝试在我的 Android 应用程序中使用 LocationClient 实现
所以我只是尝试使用 NDK 构建一个库。我相信 Android.mk 和 Application.mk 文件是正确的,但它们是否正确无关紧要。 在NDK目录下执行make APP=hello时 And
我在 Android Studio 中尝试为我的模拟器安装 HAXM 时遇到了困难。我有一台 hp2000 笔记本;我将 Windows 8.1 更新到 Windows 8.1 Pro 以激活 Hyp
在我的程序中,我正在下载 misc。 PDF 文档,最后我想使用 Apache pdfbox (v1.8.8) 将它们合并到一个组合文档中。出于某种奇怪的原因,PDFMergerUtility 未能声
我正在尝试使用预先编写的接口(interface)编写队列类。接口(interface)包含方法 public void enqueue(T element); 我的类(class)看起来像 impo
有这样的东西: $(document).ready(function() { $("#myTable").dataTable({
我最近将一个 Android 应用程序从 Eclipse 移植到 Android Studio。我能够调试应用程序,甚至能够构建一个供客户端测试的发布版本。不幸的是,我不能再调试了。当我尝试从 And
每次,我在 Gerrit 中看到我的更改的 merged 状态并且我执行 git pull origin,我可以清楚地看到,我的更改/分支实际上没有已 merge 到 master 中。 请检查我的
我是一名优秀的程序员,十分优秀!