Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
905 views
in Technique[技术] by (71.8m points)

playframework - I'm getting NoSuchMethodError where play.db.ebean.getReflectionsConfiguration calls org.reflections.util.ConfigurationBuilder.filterInputsBy

When running an application ported from Play 2.5 to Play 2.8 I get the following error: ! @7igpea0lh - Internal server error, for (GET) [/] ->

    at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:215)
    at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:142)
    at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:302)
    at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:224)
    at akka.stream.impl.fusing.MapAsync$$anon$30.onPush(Ops.scala:1284)
    at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:541)
    at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:423)
    at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:625)
    at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:502)
    at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:600)
Caused by: java.lang.NoSuchMethodError: org.reflections.util.ConfigurationBuilder.filterInputsBy(Lcom/google/common/base/Predicate;)Lorg/reflections/util/ConfigurationBuilder;
    at play.db.ebean.DefaultEbeanConfig$Classpath.getReflectionsConfiguration(DefaultEbeanConfig.java:235)
    at play.db.ebean.DefaultEbeanConfig$Classpath.getReflections(DefaultEbeanConfig.java:222)
    at play.db.ebean.DefaultEbeanConfig$Classpath.getTypes(DefaultEbeanConfig.java:217)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.lambda$getModelClasses$0(DefaultEbeanConfig.java:131)
    at java.util.ArrayList.forEach(ArrayList.java:1259)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.getModelClasses(DefaultEbeanConfig.java:128)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.parse(DefaultEbeanConfig.java:91)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:64)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:85)

The dependency list is:

libraryDependencies ++= Seq(
  jdbc,
  javaJdbc,
  ehcache,
  javaWs,
  filters,
  evolutions,
  "com.typesafe.play" %% "play-guice" % "[2.8,)",
  "com.nimbusds" % "nimbus-jose-jwt" % "[5.0,)",
  "org.mindrot" % "jbcrypt" % "[0.4,)",
  "org.postgresql" % "postgresql" % "42.2.18",
  "org.scala-lang" % "scala-library" % scalaVersion.value,
  "com.typesafe.play" %% "play-ebean" % "[6.0,)",
  "com.typesafe.play" %% "play-java" % "2.8.5",
  "com.typesafe.play" %% "play-jdbc" % "2.8.5",
  "com.typesafe.play" %% "play-jdbc-evolutions" % "2.8.5",
  "com.typesafe.play" %% "play-mailer" % "[6.0,)",
  "com.typesafe.play" %% "play-mailer-guice" % "[6.0,)",
  "org.apache.commons" % "commons-lang3" % "3.4+",
  "org.apache.poi" % "poi" % "3.15",
  "org.apache.poi" % "poi-ooxml" % "3.15",
  "org.apache.poi" % "poi-ooxml-schemas" % "3.15",
  "org.apache.poi" % "ooxml-schemas" % "1.3",
  "commons-net" % "commons-net" % "3.6",
  "com.typesafe.akka" %% "akka-cluster" % "2.6.10",
  "com.typesafe.akka" %% "akka-persistence" % "2.6.10",
  "com.typesafe.akka" %% "akka-protobuf" % "2.6.10",
  "com.typesafe.akka" %% "akka-persistence-query" % "2.6.10",
  "net.sf.jsignature.io-tools" % "easystream" % "1.2.15" excludeAll ExclusionRule(organization = "org.slf4j"),
  "com.amazonaws" % "aws-java-sdk-s3" % "1.11.313",
  "org.reflections" % "reflections" % "0.9.12",
  "io.ebean" % "ebean" % "[12.6,)",
  "io.ebean" % "ebean-agent" % "[12.6,)",
  "io.ebean" % "ebean-annotation" % "[6.15,)",
  "io.ebean" % "ebean-querybean" % "[12.6,)",
  "io.ebean" % "ebean-maven-plugin" % "[12.6,)"
)

And when I researched play-ebean version 6 and org.reflections 0.9.12, they appear to have the correct versions to match that method.

Running the 'evicted' task in sbt reveals the following warnings though:

[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * org.reflections:reflections:0.9.12 is selected over 0.9.11
[warn]      +- comcast:comcast_2.13:0-LOCAL-SNAPSHOT              (depends on 0.9.12)
[warn]      +- com.typesafe.play:play-ebean_2.13:6.0.0            (depends on 0.9.11)
[warn]  * io.ebean:ebean-agent:12.6.6 is selected over 11.45.1
[warn]      +- comcast:comcast_2.13:0-LOCAL-SNAPSHOT              (depends on 12.6.6)
[warn]      +- io.ebean:ebean-maven-plugin:12.6.6                 (depends on 12.6.6)
[warn]      +- com.typesafe.play:play-ebean_2.13:6.0.0            (depends on 11.45.1)
[warn]  * org.checkerframework:checker-qual:3.5.0 is selected over 2.10.0
[warn]      +- org.postgresql:postgresql:42.2.18                  (depends on 3.5.0)
[warn]      +- com.google.guava:guava:28.2-jre                    (depends on 2.10.0)
[warn]  * com.google.guava:guava:28.2-jre is selected over 27.1-jre
[warn]      +- com.typesafe.play:play_2.13:2.8.7                  (depends on 28.2-jre)
[warn]      +- com.google.inject:guice:4.2.3                      (depends on 27.1-jre)

I would like to stay with Play 2.8/Java 1.8/Scala 2.13 if that is possible, but certainly Play 2.8/Java 1.8 at the least.

Thanks in advance, DTS

question from:https://stackoverflow.com/questions/65892685/im-getting-nosuchmethoderror-where-play-db-ebean-getreflectionsconfiguration-ca

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I created a pay framework project with build.sbt having following contents and it is working fine.

name := "playf"
 
version := "1.0" 
      
lazy val `playf` = (project in file(".")).enablePlugins(PlayScala)

resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
      
resolvers += "Akka Snapshot Repository" at "https://repo.akka.io/snapshots/"
      
scalaVersion := "2.12.2"

//libraryDependencies ++= Seq( jdbc , ehcache , ws , specs2 % Test , guice )
libraryDependencies ++= Seq(
  jdbc,
  javaJdbc,
  ehcache,
  javaWs,
  filters,
  evolutions,
  "com.typesafe.play" %% "play-guice" % "[2.8,)",
  "com.nimbusds" % "nimbus-jose-jwt" % "[5.0,)",
  "org.mindrot" % "jbcrypt" % "[0.4,)",
  "org.postgresql" % "postgresql" % "42.2.18",
  "org.scala-lang" % "scala-library" % scalaVersion.value,
  "com.typesafe.play" %% "play-ebean" % "[6.0,)",
  "com.typesafe.play" %% "play-java" % "2.8.5",
  "com.typesafe.play" %% "play-jdbc" % "2.8.5",
  "com.typesafe.play" %% "play-jdbc-evolutions" % "2.8.5",
  "com.typesafe.play" %% "play-mailer" % "[6.0,)",
  "com.typesafe.play" %% "play-mailer-guice" % "[6.0,)",
  "org.apache.commons" % "commons-lang3" % "3.4+",
  "org.apache.poi" % "poi" % "3.15",
  "org.apache.poi" % "poi-ooxml" % "3.15",
  "org.apache.poi" % "poi-ooxml-schemas" % "3.15",
  "org.apache.poi" % "ooxml-schemas" % "1.3",
  "commons-net" % "commons-net" % "3.6",
  "com.typesafe.akka" %% "akka-cluster" % "2.6.10",
  "com.typesafe.akka" %% "akka-persistence" % "2.6.10",
  "com.typesafe.akka" %% "akka-protobuf" % "2.6.10",
  "com.typesafe.akka" %% "akka-persistence-query" % "2.6.10",
  "net.sf.jsignature.io-tools" % "easystream" % "1.2.15" excludeAll ExclusionRule(organization = "org.slf4j"),
  "com.amazonaws" % "aws-java-sdk-s3" % "1.11.313",
  "org.reflections" % "reflections" % "0.9.12",
  "io.ebean" % "ebean" % "[12.6,)",
  "io.ebean" % "ebean-agent" % "[12.6,)",
  "io.ebean" % "ebean-annotation" % "[6.15,)",
  "io.ebean" % "ebean-querybean" % "[12.6,)",
  "io.ebean" % "ebean-maven-plugin" % "[12.6,)"
)

unmanagedResourceDirectories in Test <+=  baseDirectory ( _ /"target/web/public/test" )  

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...