mkurz / deadbolt-2-scala

Idiomatic Scala API for Deadbolt 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Library inconsistencies with 2.4.2

moxious opened this issue · comments

Using the latest release together with play seems to result in errors, and library inconsistencies. Is it possible that deadbolt 2.4.2 is built on an old play?

Build.sbt dependencies:

libraryDependencies ++= Seq(
  "com.google.inject" % "guice" % "4.0",
  "javax.inject" % "javax.inject" % "1",
  "org.webjars" %% "webjars-play" % "2.4.0",
  "org.webjars" % "bootstrap" % "3.3.4",
  "org.webjars" % "angularjs" % "1.3.15",
  "org.webjars" % "angular-ui-bootstrap" % "0.13.0",
  "org.mockito" % "mockito-core" % "1.10.19" % "test",
  "be.objectify" %% "deadbolt-scala" % "2.4.2"
)

And the problem:

[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]  * com.typesafe.play:play_2.11:2.3.9 -> 2.4.0
[warn]  * com.typesafe.play:twirl-api_2.11:1.0.2 -> 1.1.1
[warn] Run 'evicted' to see detailed eviction warnings

java.lang.NoSuchMethodException: play.core.server.NettyServer.mainDevHttpMode(play.core.BuildLink, play.core.BuildDocHandler, int)
    at java.lang.Class.getMethod(Class.java:1786)
    at play.runsupport.Reloader$.startDevMode(Reloader.scala:196)
    at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:75)
    at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$PlayRun$class$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:75)
    at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:98)
    at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:54)
    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.NoSuchMethodException: play.core.server.NettyServer.mainDevHttpMode(play.core.BuildLink, play.core.BuildDocHandler, int)
[error] Total time: 0 s, completed Dec 18, 2015 4:42:56 PM

Hmm, odd. Each x.y.z build of Deadbolt uses x.y.0 to create the binaries, so in this case it's building with 2.4.0. Which version of Play are you using?

I'm using activator-dist 1.3.6, packaged with scala 2.11.7. Per dependencies above, play is 2.4.0.

I can see in the published dependency list that it's using Play 2.4.0: http://search.maven.org/#artifactdetails%7Cbe.objectify%7Cdeadbolt-scala_2.11%7C2.4.2%7Cjar - maybe you can use sbt-dependency-graph to determine the issue?

I created a new project using Play 2.4 with the following library dependencies (based on what you wrote above):

libraryDependencies ++=
  Seq(
       jdbc,
       cache,
       ws,
       specs2 % Test
     )

libraryDependencies ++=
  Seq(
       "com.google.inject" % "guice" % "4.0",
       "javax.inject" % "javax.inject" % "1",
       "org.webjars" %% "webjars-play" % "2.4.0",
       "org.webjars" % "bootstrap" % "3.3.4",
       "org.webjars" % "angularjs" % "1.3.15",
       "org.webjars" % "angular-ui-bootstrap" % "0.13.0",
       "org.mockito" % "mockito-core" % "1.10.19" % "test",
       "be.objectify" %% "deadbolt-scala" % "2.4.2"
     )

Using whatDepends to check on usages of the Play 2.3.9 and Twirl 1.0.2 , the results are

[depIssue] $ whatDependsOn com.typesafe.play play_2.11 2.3.9
[error] Expected '2.4.6'
[error] Expected '2.4.0'
[error] whatDependsOn com.typesafe.play play_2.11 2.3.9
[error]                                             ^
[depIssue] $ whatDependsOn com.typesafe.play twirl-api_2.11 1.0.2
[error] Expected '1.1.1'
[error] whatDependsOn com.typesafe.play twirl-api_2.11 1.0.2
[error]                                                  ^

Similarly, the full dependency listing doesn't show any sign of it. Is it possible you have something related to Play 2.3.9 in your global .sbt config?