[2.2-scala] onStart is called twice ?! (run & start)

170 views
Skip to first unread message

Otto

unread,
Oct 11, 2013, 10:10:58 AM10/11/13
to play-fr...@googlegroups.com
Hi,

I've just upgraded our project to Play 2.2 and apparently, both in run and start, the onStart method is triggered twice:

[success] Compiled in 380ms
Go 2013-10-11T16:09:28.000+02:00
[info] application - MongoDBConnectionConfig(localhost,4040,ua,None)
[info] play - Starting application default Akka system.
[info] application - Running app in CR-Mode: Dev
Go 2013-10-11T16:09:28.686+02:00
[info] application - MongoDBConnectionConfig(localhost,4040,ua,None)
[info] application - Running app in CR-Mode: Dev
[info] play - Application started (Dev)


Any Idea?

Thanks,
Otto

Johan Andren

unread,
Oct 11, 2013, 1:28:28 PM10/11/13
to play-fr...@googlegroups.com
Start play in debug mode and set a breakpoint to see how the call stack looks, what caused the onStart invocation!

Otto

unread,
Oct 14, 2013, 11:32:03 AM10/14/13
to play-fr...@googlegroups.com
Hm,

I've tried that and the callstacks seem to be similar, screenshots attached. This error occurred after the update to 2.2.

Otto
Bildschirmfoto 2013-10-14 um 15.35.06.png
Bildschirmfoto 2013-10-14 um 15.35.29.png

Johan Andren

unread,
Oct 14, 2013, 2:15:41 PM10/14/13
to play-fr...@googlegroups.com
Yupp. Certainly looks identical, so I guess it is the app restart that is triggered multiple times for some reason.

You doing any special sbt stuff with the build, like custom resource processing, js compiler etc?

Otto

unread,
Oct 15, 2013, 3:35:51 AM10/15/13
to play-fr...@googlegroups.com
Nothing spectecular:


import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName = "reactor"

 val appVersion = "0.1-SNAPSHOT"

 scalaVersion := "2.10.2"

  val main = play.Project(appName, appVersion, Seq()).settings(

    Keys.fork in (Test) := false,

   // Add your own project settings here      
     libraryDependencies ++= Seq(

     //cache, // somehow already imported by dependency?!

     rogueField,

     rogueCore,

     rogueIndex,

     rogueLift,

     liftMongoRecord,

     scrypt,

     opencsv,

     enumFormSupport,

     email))

 //

  // -- external dependencies

 //

 // TODO find out who's importing: exclude("org.scala-stm", "scala-stm_2.10.0")

 // MONGODB

 val rogueField = "com.foursquare" %% "rogue-field" % "2.2.0" intransitive () exclude ("org.scala-stm", "scala-stm_2.10.0")

 val rogueCore = "com.foursquare" %% "rogue-core" % "2.2.0" intransitive () exclude ("org.scala-stm", "scala-stm_2.10.0")

 val rogueIndex = "com.foursquare" %% "rogue-index" % "2.2.0" intransitive () exclude ("org.scala-stm", "scala-stm_2.10.0")

 val rogueLift = "com.foursquare" %% "rogue-lift" % "2.2.0" intransitive () exclude ("org.scala-stm", "scala-stm_2.10.0")

 val liftMongoRecord = "net.liftweb" %% "lift-mongodb-record" % "2.5" exclude ("org.scala-stm", "scala-stm_2.10.0")

 // Scrypt - Password hashing

 val scrypt = "com.lambdaworks" % "scrypt" % "1.3.2" // https://github.com/wg/scrypt

 // OpenCSV

 val opencsv = "net.sf.opencsv" % "opencsv" % "2.1"

 // EnumSupport

 val enumFormSupport = "se.radley" %% "play-plugins-enumeration" % "1.0.2" exclude ("org.scala-stm", "scala-stm_2.10.0")

 // Email

 val email = "com.typesafe" %% "play-plugins-mailer" % "2.2.0" exclude ("org.scala-stm", "scala-stm_2.10.0")

}




Otto

unread,
Oct 15, 2013, 4:53:50 AM10/15/13
to play-fr...@googlegroups.com
Ok, i think i found the error. Probably this occurs when you depend on a plugin which is build against an older play version, not totally sure about that.
But adding exclude("play", "*") did the trick.

val email = "com.typesafe" %% "play-plugins-mailer" % "2.2.0" exclude ("org.scala-stm", "scala-stm_2.10.0") exclude("play", "*")

Otto

Reply all
Reply to author
Forward
0 new messages