NoSuchMethodError: Akka 2.5-M2 and Akka-Http 10.0.4

211 views
Skip to first unread message

Rob Crawford

unread,
Mar 7, 2017, 4:49:43 PM3/7/17
to Akka User List
From my understanding of the binary compatibility statement, these should work together, but after I start an Akka-http server, I get this exception:

java.lang.NoSuchMethodError: akka.actor.ActorCell.addFunctionRef(Lscala/Function2;)Lakka/actor/FunctionRef;
at akka.stream.stage.GraphStageLogic$StageActor.<init>(GraphStage.scala:142)
at akka.stream.stage.GraphStageLogic.getStageActor(GraphStage.scala:929)
...

Now, I'm starting this from inside an actor, but didn't think that would be an issue. I've tried starting the Http server from main(), but it throws the same exception. To start it, I'm doing this:

ActorSystem system = getContext().system();

final HttpBinding myServer = new HttpBinding();
myServer.startServer("localhost", 8080, ServerSettings.create(system), system);

The HttpBinding class is:

public class HttpBinding extends HttpApp {

protected Route route() {
return path("hello", () ->
get(() ->
complete("<h1>Say hello to akka-http</h1>")
)
);
}
}

I've checked the dependencies, and nothing's brought in an older version of akka. I'm using the Scala 2.12 versions of everything. From my build.gradle:

compile group: 'com.typesafe.akka', name: 'akka-actor_2.12', version: '2.5-M2'
compile group: 'com.typesafe.akka', name: 'akka-persistence_2.12', version: '2.5-M2'
compile group: 'com.typesafe.akka', name: 'akka-slf4j_2.12', version: '2.5-M2'

compile group: 'com.typesafe.akka', name: 'akka-http_2.12', version: '10.0.4'

The only place I've seen a similar exception discussed was a StackOverflow question that involved Play, and I'm not using Play. Any suggestions on 
where to look for the problem? Or should I just wait for the final release of Akka 2.5 and Akka-Http to catch up?

Thanks!

Patrik Nordwall

unread,
Mar 8, 2017, 4:34:24 AM3/8/17
to akka...@googlegroups.com

--
>>>>>>>>>> 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 akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Akka Tech Lead
Lightbend -  Reactive apps on the JVM
Twitter: @patriknw

Rob Crawford

unread,
Mar 8, 2017, 9:04:57 AM3/8/17
to Akka User List
That was it! Thanks -- I'll remember to triple-check the transitive dependencies from now on! 

Patrik Nordwall

unread,
Mar 8, 2017, 9:28:19 AM3/8/17
to akka...@googlegroups.com
You're welcome.

--
>>>>>>>>>> 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 akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Sunil Mandowara

unread,
Sep 13, 2017, 3:56:41 AM9/13/17
to Akka User List

its works after including akka-stream dependency (transitive) with never version.
  "com.typesafe.akka" %% "akka-http" % "10.0.10",
  "com.typesafe.akka" %% "akka-actor" % "2.5.4",
  "com.typesafe.akka" %% "akka-stream" % "2.5.4",  
  "com.typesafe.akka" %% "akka-http-spray-json" % "10.0.10"
Reply all
Reply to author
Forward
0 new messages