When you start "play", java.lang.NoSuchMethodError appears

I am trying to start a clone of a playback project that I got from git clone https://github.com/djonmayer/play21-osm.git

I have version 2.2.2 installed and scala version 2.10.4.

When I print a game in the directory that the project is cloning to, I get the following error:

java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps; at sbt.ConsoleLogger$.<init>(ConsoleLogger.scala:129) at sbt.ConsoleLogger$.<clinit>(ConsoleLogger.scala) at sbt.StandardMain$.<init>(Main.scala:52) at sbt.StandardMain$.<clinit>(Main.scala) at sbt.xMain.run(Main.scala:26) at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:57) at xsbt.boot.Launch$.withContextLoader(Launch.scala:77) at xsbt.boot.Launch$.run(Launch.scala:57) at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45) at xsbt.boot.Launch$.launch(Launch.scala:65) at xsbt.boot.Launch$.apply(Launch.scala:16) at xsbt.boot.Boot$.runImpl(Boot.scala:32) at xsbt.boot.Boot$.main(Boot.scala:21) at xsbt.boot.Boot.main(Boot.scala) Error during sbt execution: java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps; 

This is true if I ran play clean . I read that it could be a dependency problem, so I tried to add the line scalaVersion := "2.10.4" to the play.Project.settings Build.scala section and separately in the build.sbt file. This did not work.

+7
scala playframework sbt
source share
2 answers

I tried to put this in a comment, but it was unreadable.

Thanks, zeppaman. This problem seems to be related to the launch of the Play Framework project, which was created in the old version of Play. After studying another project that made the transition to a new version of the game, I made the following changes.

In build.properties:

 sbt.version=0.12.2 

become:

 sbt.version=0.13.0 

In plugins.sbt:

 addSbtPlugin("play" % "sbt-plugin" % "2.1.1") 

became:

 addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2") 

This allowed me to get the update and then throw errors:

 [error] Modules were resolved with conflicting cross-version suffixes in {file:/Users/michaelrichardson/Documents/Play/play21-osm/}play21-osm: [error] org.scala-stm:scala-stm _2.10, _2.10.0 [trace] Stack trace suppressed: run last *:update for the full output. [error] (*:update) Conflicting cross-version suffixes in: org.scala-stm:scala-stm 

I am changing the line in Build.scala:

  "com.typesafe.play" %% "play-slick" % "0.3.2" 

became:

  "com.typesafe.play" %% "play-slick" % "0.5.0.2-SNAPSHOT" 

EXTRA: This changes the error to:

 [info] Resolving com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT ... [warn] module not found: com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT [warn] ==== Typesafe Releases Repository: tried [warn] http://repo.typesafe.com/typesafe/releases/com/typesafe/play/play-slick_2.10/0.5.0.2-SNAPSHOT/play-slick_2.10-0.5.0.2-SNAPSHOT.pom [info] Resolving org.fusesource.jansi#jansi;1.4 ... [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [trace] Stack trace suppressed: run last *:update for the full output. [error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT: not found 

UPDATE: Resolved unresolved dependency

The unresolved dependency problem seems that this could be due to damage to the local sbt / ivy repositories. See unresolved dependency: com.typesafe.play # play-slick_2.10; 0.6.0.1: not found

+8
source share

This problem is often associated with two similar flaws:

  • missing jar with the same class
  • same class in several cans

Therefore, check if scala and the playback version are compatible, and if you include a jar that already contains a class with a missing method.

+1
source share

All Articles