softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.51k stars 194 forks source link

Incompatible akka-actor dependency with 0.13.3 #107

Closed janderson007 closed 7 years ago

janderson007 commented 7 years ago

I'm running elasticmq-rest in embedded mode for an integration test and get the following error

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.1 (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 [elasticmq-akka.actor.default-dispatcher-4] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[elasticmq]
    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)

Tracking down the dependencies (using gradle) shows that some of akka-http's transitive dependencies is expecting 2.4.17, rather than 2.5.1

+--- org.elasticmq:elasticmq-rest-sqs_2.11:0.13.3
     |    +--- org.scala-lang:scala-library:2.11.11
     |    +--- org.elasticmq:elasticmq-core_2.11:0.13.3 (*)
     |    +--- org.scala-lang.modules:scala-xml_2.11:1.0.6 (*)
     |    +--- com.typesafe.akka:akka-actor_2.11:2.5.1 (*)
     |    +--- com.typesafe.akka:akka-slf4j_2.11:2.5.1
     |    |    +--- org.scala-lang:scala-library:2.11.11
     |    |    +--- com.typesafe.akka:akka-actor_2.11:2.5.1 (*)
     |    |    \--- org.slf4j:slf4j-api:1.7.23 -> 1.7.25
     |    +--- com.typesafe.akka:akka-http_2.11:10.0.6
     |    |    +--- org.scala-lang:scala-library:2.11.8 -> 2.11.11
     |    |    \--- com.typesafe.akka:akka-http-core_2.11:10.0.6
     |    |         +--- org.scala-lang:scala-library:2.11.8 -> 2.11.11
     |    |         +--- com.typesafe.akka:akka-parsing_2.11:10.0.6
     |    |         |    +--- org.scala-lang:scala-library:2.11.8 -> 2.11.11
     |    |         |    \--- com.typesafe.akka:akka-actor_2.11:2.4.17 -> 2.5.1 (*)
     |    |         \--- com.typesafe.akka:akka-stream_2.11:2.4.17
     |    |              +--- org.scala-lang:scala-library:2.11.8 -> 2.11.11
     |    |              +--- com.typesafe.akka:akka-actor_2.11:2.4.17 -> 2.5.1 (*)
     |    |              +--- org.reactivestreams:reactive-streams:1.0.0
     |    |              \--- com.typesafe:ssl-config-core_2.11:0.2.1
     |    |                   +--- org.scala-lang:scala-library:2.11.8 -> 2.11.11
     |    |                   +--- com.typesafe:config:1.2.0 -> 1.3.1
     |    |                   \--- org.scala-lang.modules:scala-parser-combinators_2.11:1.0.4
     |    |                        \--- org.scala-lang:scala-library:2.11.6 -> 2.11.11

Downgrading to 0.13.2 fixes the issue.

adamw commented 7 years ago

@ktoso is using akka-http 10.0.6 and akka 2.5.1 a safe combination? I had the impression that's the case from the latest release notes, but maybe I misunderstood something?

adamw commented 7 years ago

Hm one more thought - can you try adding an explicit dependency on akka-stream 2.5.1? Maybe that's what's missing.

No idea why the tests would work then, but well ... transitive depedencies ;)

ktoso commented 7 years ago

Yes 2.5.1 can be used with 10.0.6. We don't depend on it yet to make sure we still can run on 2.4

janderson007 commented 7 years ago

Adding the explicit dependency on akka-stream 2.5.1 works.

adamw commented 7 years ago

I added an explicit dependency to elasticmq as well, released in 0.13.4