[2.3-RC-1] activator run throws exception

156 views
Skip to first unread message

oblivion

unread,
May 16, 2014, 4:07:18 PM5/16/14
to play-fr...@googlegroups.com
Hi,

activator run yields a strange exception

[info] Resolving jline#jline;2.11 ...
[info] Done updating.

java.util.NoSuchElementException: next on empty iterator
        at scala.collection.Iterator$$anon$2.next(Iterator.scala:39)
        at scala.collection.Iterator$$anon$2.next(Iterator.scala:37)
        at scala.collection.IndexedSeqLike$Elements.next(IndexedSeqLike.scala:64)
        at scala.collection.IterableLike$class.head(IterableLike.scala:91)
        at scala.collection.mutable.ArraySeq.scala$collection$IndexedSeqOptimized$$super$head(ArraySeq.scala:45)
        at scala.collection.IndexedSeqOptimized$class.head(IndexedSeqOptimized.scala:120)
        at scala.collection.mutable.ArraySeq.head(ArraySeq.scala:45)
        at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:184)
        at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:97)
        at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:35)
        at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:34)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)


My build.sbt looks as follows:

val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.0"

scalacOptions ++= Seq("-feature", "-language:postfixOps", "-language:existentials")

libraryDependencies := Seq(jdbc, anorm, cache)

Rich Dougherty

unread,
May 18, 2014, 7:20:04 AM5/18/14
to play-framework
That's strange. The error happens in this code in PlayRun.scala.

val docsJarFile = {
  val f = docsAppClasspath.map(_.data).filter(_.getName.startsWith("play-docs")).head
  new JarFile(f)

Can you run "show docs:managedClasspath" inside activator and look at the list of JARs that is printed out. You should see a JAR called "play-docs" in the list.

You might also want to run "show compile:managedClasspath" and see if it's in that list.

Cheers
Rich

--
Rich Dougherty - @richdougherty
Typesafe - Reactive apps on the JVM

Mohsen Kashi

unread,
May 19, 2014, 2:18:44 AM5/19/14
to play-fr...@googlegroups.com
Sometimes SBT has some lags in downloading dependencies, and dependencies downloaded imperfect.
My recommendation is deleting .sbt and .ivy folders , and redownload dependencies

Ahmed Soliman

unread,
Jul 14, 2014, 8:12:28 AM7/14/14
to play-fr...@googlegroups.com
I've exactly the same problem after upgrading to Play 2.3 and refactoring the build scripts to remove the play.Project construct. my output of "show docs:managedClasspath" returns an empty List()

and by printing  compile:managedClasspath  I can see among the long list those two elements:

Attributed(/Users/asoliman/.ivy2/cache/com.typesafe.play/play-docs_2.10/jars/play-docs_2.10-2.3.1.jar), Attributed(/Users/asoliman/.ivy2/cache/com.typesafe.play/play-doc_2.10/jars/play-doc_2.10-1.1.0.jar)

Did anyone manage to fix this issue?

Chris Birchall

unread,
Aug 19, 2014, 2:28:26 AM8/19/14
to play-fr...@googlegroups.com
I just wasted an hour debugging a similar problem. In my case, my Build.scala looked like

lazy val app = Project(id = "foo", base = file("."))
    .enablePlugins(PlayScala)
    .settings(
        libraryDependencies := Seq(...)
    )
)

So I was accidentally overwriting the dependencies that were added by the Play plugin.

Rewriting to libraryDependencies ++= Seq(...) fixed the problem.

Paul Draper

unread,
Sep 21, 2014, 10:22:26 PM9/21/14
to play-fr...@googlegroups.com
Thanks Chris. I made the same mistake. (And thanks to you didn't have to spend an hour :)
Reply all
Reply to author
Forward
0 new messages