我在SBT中使用调度库来做简单的Http GET请求。
我的代码:
django-admin compilemessages
当我从SBT控制台运行时,它显示以下unKnown错误。有人知道这里有什么问题吗?
def getReq(){
val svc = url(GlobalObjects.BASE_GET_REQUEST_URL);
val response : Future[String] = Http(svc OK as.String)
response onComplete {
case Success(content) => {
println("Successful response" + content)
}
case Failure(t) => {
println("An error has occurred: " + t.getMessage)
}
}
}
}
如果我发布我的build.sbt也是如此。
我的build.sbt:
[error] (run-main) java.lang.NoSuchMethodError: scala.runtime.ObjectRef.zero()Ls
cala/runtime/ObjectRef;
java.lang.NoSuchMethodError: scala.runtime.ObjectRef.zero()Lscala/runtime/Object
Ref;
at dispatch.InternalDefaults$SbtProcessDefaults$.builder(defaults.scala)
at dispatch.InternalDefaults$.client(defaults.scala:32)
at dispatch.Http$.<init>(execution.scala:30)
at dispatch.Http$.<clinit>(execution.scala)
at com.czechscala.blank.User.getReq(User.scala:30)
at com.czechscala.blank.Hello$.main(Hello.scala:81)
at com.czechscala.blank.Hello.main(Hello.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
[trace] Stack trace suppressed: run 'last compile:run' for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run 'last compile:run' for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 4 s, completed May 24, 2015 9:00:58 PM
答案 0 :(得分:0)
似乎与您的其他问题相同。
net.databinder.dispatch使用2.11而不是2.10。