Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http example compile errors? #2

Open
nacmacfeegle opened this issue Feb 12, 2015 · 1 comment
Open

http example compile errors? #2

nacmacfeegle opened this issue Feb 12, 2015 · 1 comment

Comments

@nacmacfeegle
Copy link

Great project + supporting blog post.

I'm trying to get the http example going and getting compile errors. Tried out of the box on 2 systems, each producing the errors below.

Any idea what might be wrong?

$ sbt akka-http-example/run
[info] Loading project definition from /private/tmp/akka-http-stream-example/project
[info] Set current project to akka-http-stream-example (in build file:/private/tmp/akka-http-stream-example/)
[warn] Scala version was updated by one of library dependencies:
[warn]  * org.scala-lang:scala-library:(2.11.2, 2.11.0, 2.11.1) -> 2.11.5
[warn] To force scalaVersion, add the following:
[warn]  ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings
[info] Compiling 6 Scala sources to /private/tmp/akka-http-stream-example/akka-http-example/target/scala-2.11/classes...
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpClient.scala:25: inferred type arguments [akka.http.HttpExt] do not conform to method apply's type parameter bounds [T <: akka.io.IO.Extension]
[error]       val connFuture = IO(Http).ask(Http.Connect("127.0.0.1", port)).mapTo[Http.OutgoingConnection]
[error]                        ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpClient.scala:25: type mismatch;
[error]  found   : akka.http.Http.type
[error]  required: akka.actor.ExtensionId[T]
[error]       val connFuture = IO(Http).ask(Http.Connect("127.0.0.1", port)).mapTo[Http.OutgoingConnection]
[error]                           ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpClient.scala:25: value Connect is not a member of object akka.http.Http
[error]       val connFuture = IO(Http).ask(Http.Connect("127.0.0.1", port)).mapTo[Http.OutgoingConnection]
[error]                                          ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpClient.scala:28: type mismatch;
[error]  found   : List[(akka.http.model.HttpRequest, Symbol)]
[error]  required: akka.stream.scaladsl.PartialFlowGraph
[error]       Flow(List(request -> 'NoContext)).produceTo(connection.processor)
[error]                ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpServer.scala:19: inferred type arguments [akka.http.HttpExt] do not conform to method apply's type parameter bounds [T <: akka.io.IO.Extension]
[error]     val bindingFuture = IO(Http) ? Http.Bind(interface = "localhost", port = port)
[error]                         ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpServer.scala:19: type mismatch;
[error]  found   : akka.http.Http.type
[error]  required: akka.actor.ExtensionId[T]
[error]     val bindingFuture = IO(Http) ? Http.Bind(interface = "localhost", port = port)
[error]                            ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpServer.scala:19: value Bind is not a member of object akka.http.Http
[error]     val bindingFuture = IO(Http) ? Http.Bind(interface = "localhost", port = port)
[error]                                         ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpServer.scala:19: not found: value interface
[error]     val bindingFuture = IO(Http) ? Http.Bind(interface = "localhost", port = port)
[error]                                              ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/HttpServer.scala:19: reassignment to val
[error]     val bindingFuture = IO(Http) ? Http.Bind(interface = "localhost", port = port)
[error]                                                                            ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/Main.scala:39: type mismatch;
[error]  found   : org.reactivestreams.Publisher[akka.http.model.HttpEntity.ChunkStreamPart]
[error]  required: akka.stream.scaladsl.Source[akka.http.model.HttpEntity.ChunkStreamPart]
[error]           entity = new Chunked(MediaTypes.`text/plain`, publisher)
[error]                                                         ^
[error] /private/tmp/akka-http-stream-example/akka-http-example/src/main/scala/StreamClientPublisher.scala:26: akka.stream.scaladsl.Source[akka.util.ByteString] does not take parameters
[error]       response.entity.dataBytes(materializer).subscribe(processorSubscriber)
[error]                                ^
[error] 11 errors found
[error] (akka-http-example/compile:compile) Compilation failed
[error] Total time: 2 s, completed 12-Feb-2015 09:56:44
@jkuru
Copy link

jkuru commented Aug 30, 2015

i had the same issue, was able to get past the issue by updating the version of these two lib in Build.Scala
val akkaHttp = "com.typesafe.akka" %% "akka-http-core-experimental" % "0.7"
val akkaStream = "com.typesafe.akka" %% "akka-stream-experimental" % "0.2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants