Hi Everyone,
I thought I would start learning about Akka http / streaming and so have
added them to my depoendencies in build.sbt.
But am now getting an error whenever I try to RUN my Play application.
I am not sure what I can provide to help with this one;
Hopefully it is just something "silly" that I have missed.
I am not currently using Akka (at all) in an application that has only just
been started.
So I figured that I can add the latest release of Akka (actors) and also
use the 2.0-M1 release of HTTP / STREAMS, as the application isn't in
production etc.
All I did was add the library dependencies to my current application, and
now it won't run.
Strangely, it compiles fine and the tests I have so far for the application
run, too.
But when attempting to "run" the application I get an error.
Here is ther only change that I have made to build.sbt;
(I have made no other changes to any code - just the addition of the
dependencies)
"com.typesafe.akka" % "akka-stream-experimental_2.11" % "2.0-M1",
"com.typesafe.akka" % "akka-http-core-experimental_2.11" % "2.0-M1",
"com.typesafe.akka" % "akka-http-experimental_2.11" % "2.0-M1",
(with these three removed, I can can successfully compile, test and run my
application)
Here is the error I receive when attempting to run;
java.lang.NoSuchMethodError:
akka.stream.ActorMaterializer$.apply$default$3()Lakka/stream/Optimizations;
at
play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:208)
at
play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:62)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:61)
at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:51)
at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:223)
at
play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74)
at
play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74)
at
play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
at
play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.reflect.InvocationTargetException
And finally here is the build.sbt in it's entirety;
name := """emr"""
version := "0.1.1"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.7"
// Dependencies required by THIS application.
libraryDependencies ++= {
val akkaVersion = "2.4.0"
val akkaStreamsVersion = "2.0-M1"
val akkaHttpVersion = "2.0-M1"
Seq(
cache,
ws,
jdbc,
evolutions,
// DeadBolt Authorisation
"be.objectify" %% "deadbolt-scala" % "2.4.2",
// Akka Actors
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
// Akka Persistence
"com.typesafe.akka" %% "akka-persistence" % akkaVersion,
// Akka Streams
"com.typesafe.akka" % "akka-stream-experimental_2.11" %
akkaStreamsVersion,
// Akka HTTP
"com.typesafe.akka" % "akka-http-core-experimental_2.11" %
akkaHttpVersion,
"com.typesafe.akka" % "akka-http-experimental_2.11" %
akkaHttpVersion,
// Akka Logging
"com.typesafe.akka" %% "akka-slf4j" % akkaHttpVersion,
// Akka Testing
"com.typesafe.akka" %% "akka-testkit" % akkaHttpVersion % "test",
// Scala Unit Test Framework
"org.scalatest" %% "scalatest" % "3.0.0-SNAP9" % "test"
)
}
// Play provides two styles of routers, one expects its actions to be
injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator
// To speed up compilation you can disable documentation generation:
// The first line will disable documentation generation and the second one
// will avoid to publish the documentation artifact.
sources in (Compile, doc) := Seq.empty
publishArtifact in (Compile, packageDoc) := false
// By default parallel execution is disabled and fork is enabled. You can
// change this behaviour by setting parallelExecution in Test and/or
fork
// in Test:
parallelExecution in Test := true
fork in Test := false
fork in run := true
The only other non-standard thing I can think of is that I have upgraded to
SBT 0.13.9, too.
if you can;t think of anything, or need something further from me, please
let me know, thanks!
-Gavin.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.