Tests fail due to recent upgrade to Scala 2.10

368 views
Skip to first unread message

Ben McCann

unread,
Oct 8, 2012, 1:17:03 PM10/8/12
to play-fr...@googlegroups.com
My tests fail since the recent upgrade to Scala 2.10.  I was hoping someone might have a solution.

Exception in thread "main" java.lang.NoClassDefFoundError: scala/Right
at org.specs2.runner.SpecsFramework.testRunner(TestInterfaceRunner.scala:18)
at org.specs2.runner.SpecsFramework.testRunner(TestInterfaceRunner.scala:15)
at sbt.ForkMain$Run.run(ForkMain.java:130)
at sbt.ForkMain.main(ForkMain.java:70)
Caused by: java.lang.ClassNotFoundException: scala.Right
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 4 more

Thanks,
Ben

peter hausel

unread,
Oct 8, 2012, 1:33:54 PM10/8/12
to play-fr...@googlegroups.com
I can not replicate this. Do you have a test case? Thanks Peter

Ben McCann

unread,
Oct 8, 2012, 4:56:04 PM10/8/12
to play-fr...@googlegroups.com
I was going to try to create a test case, but I'm afraid I can't get that far even :-)  Do you have any trouble creating new projects?

$ play new tmp
Getting play console_2.9.2 2.1-SNAPSHOT ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
32 artifacts copied, 0 already retrieved (9545kB/63ms)
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1-SNAPSHOT (using Scala 2.10.0-M7), http://www.playframework.org

The new application will be created in /home/bmccann/src/tmp

What is the application name? 
> tmp

Which template do you want to use for this new application? 

  1             - Create a simple Scala application
  2             - Create a simple Java application
  3             - Create an empty project
  <g8 template> - Create an app based on the g8 template hosted on Github

> 2
java.lang.NoSuchMethodError: scalax.io.Input.string$default$1()Lscalax/io/Codec;
at play.console.Console$.replace(Console.scala:29)
at play.console.Console$.generateLocalTemplate(Console.scala:61)
at play.console.Console$.newCommand(Console.scala:133)
at play.console.Console$$anonfun$10$$anonfun$apply$5.apply(Console.scala:182)
at play.console.Console$$anonfun$10$$anonfun$apply$5.apply(Console.scala:182)
at play.console.Console$$anonfun$11.apply(Console.scala:185)
at play.console.Console$$anonfun$11.apply(Console.scala:184)
at scala.Option.map(Option.scala:133)
at play.console.Console$.main(Console.scala:184)
at play.console.Console.run(Console.scala:208)
at play.console.Console.run(Console.scala:205)
at xsbt.boot.Launch$.run(Launch.scala:55)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:69)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.lang.NoSuchMethodError: scalax.io.Input.string$default$1()Lscalax/io/Codec;

peter hausel

unread,
Oct 8, 2012, 5:22:34 PM10/8/12
to play-fr...@googlegroups.com
hmm, seems to work for me:
----------------------------------------------
$ play new x
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1-SNAPSHOT, http://www.playframework.org

The new application will be created in /Users/phausel/x

What is the application name? 
> x

Which template do you want to use for this new application? 

  1             - Create a simple Scala application
  2             - Create a simple Java application
  3             - Create an empty project
  <g8 template> - Create an app based on the g8 template hosted on Github

> 2
OK, application x is created.

Have fun!
--------------

peter hausel

unread,
Oct 8, 2012, 5:25:05 PM10/8/12
to play-fr...@googlegroups.com
which version of play are you on? (I am on the latest master)

Ben McCann

unread,
Oct 8, 2012, 5:48:47 PM10/8/12
to play-fr...@googlegroups.com
Yes, I'm using the latest checked out from Github.  I just completely deleted it, did a new "git clone", and it's still broken.  Any ideas why it might be broken for me and not you?

Thanks,
Ben

Pascal Voitot Dev

unread,
Oct 8, 2012, 5:52:54 PM10/8/12
to play-fr...@googlegroups.com
I had the same problem with SBT alone outside Play with Scala 2.10-M7.
Apparently it's a problem of Specs2 version.

After some time on the web, I found a solution. I added the following dep to my project:
  "org.specs2" % "specs2_2.10.0-M7" % "1.12.1.1" % "test",

what version of Specs2 do you use in your project?

Pascal

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/kgv8p8Xdnx4J.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Ben McCann

unread,
Oct 8, 2012, 6:15:08 PM10/8/12
to play-fr...@googlegroups.com
I'm just using the default Play dependencies.  I haven't changed anything.

Ben McCann

unread,
Oct 8, 2012, 6:27:25 PM10/8/12
to play-fr...@googlegroups.com
Looks like I'm not alone in having this problem.  I just found another thread with several people complaining about not being able to run "play new"

Ben McCann

unread,
Oct 8, 2012, 6:29:56 PM10/8/12
to play-fr...@googlegroups.com
Here's what happens if I run "dependencies".  Do you have any idea why it thinks my project is using Scala 2.9.2 instead of 2.10?

[connectifier] $ dependencies
[warn] Binary version (2.10) for dependency org.scala-lang#scala-library;2.10.0-M7
[warn] in connectifier#connectifier_2.9.2;1.0-SNAPSHOT differs from Scala binary version in project (2.9.2).
[info] :: delivering :: connectifier#connectifier_2.9.2;1.0-SNAPSHOT :: 1.0-SNAPSHOT :: integration :: Mon Oct 08 15:27:58 PDT 2012
[info] delivering ivy file to /home/bmccann/src/connectifier/frontend/target/scala-2.9.2/ivy-1.0-SNAPSHOT.xml
[error] (connectifier/*:ivy-dependencies) java.io.FileNotFoundException: /home/bmccann/src/connectifier/frontend/target/resolution-cache/reports/connectifier-connectifier_2.10.0-M7/runtime-resolved.xml (No such file or directory)

Cannot compute dependencies
--
about.me/benmccann

Ben McCann

unread,
Oct 8, 2012, 6:49:32 PM10/8/12
to play-fr...@googlegroups.com
I'm not really sure what's using Scala 2.9.2 and what's using Scala 2.10.  sbteclipse is not released yet for Scala 2.10, so clearly not everything is using Scala 2.10.

I see not that I'm getting a similar warning when I run "play test" though I'm not sure what the cause is.
[warn] Binary version (2.10) for dependency org.scala-lang#scala-library;2.10.0-M7
[warn] in connectifier#connectifier_2.9.2;1.0-SNAPSHOT differs from Scala binary version in project (2.9.2).

"play new" is still not working for me either

Ben McCann

unread,
Oct 8, 2012, 8:02:34 PM10/8/12
to play-fr...@googlegroups.com
I just spent the past couple of hours rebuilding Play on various CLs to see where "play new" broke.

It's broken on this CL:

But works on the CL before it:

It's surprising to me that it would have been broken for two months without anyone noticing, but then again I very rarely run "play new" since I only am developing on one project and not developing new ones. It could possibly be some type of strange caching issue, but this seems more likely to be the case on your end than mine since I completely deleted my play installation and did a fresh "git clone".

-Ben

To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Ben McCann

unread,
Oct 8, 2012, 8:21:32 PM10/8/12
to play-fr...@googlegroups.com
Maybe it has been broken for that long.  A guy on the other thread just responded that it's been broken for at least a couple of weeks for him on several clean machines.  Can you try again with a clean build?  Maybe delete the whole Play project and "git clone" again.  That there's some type of caching happening in your local repository is the only reason I can think of as to why "play new" would work for you when it's broken for so many others.

Thanks,
Ben


To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/i_I6tZ_3QWIJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

peter hausel

unread,
Oct 8, 2012, 10:29:35 PM10/8/12
to play-fr...@googlegroups.com
to clarify: play's sbt plugin (and the plugins play is depending on)  will stay on scala 2.9.2 but play core was moved to scala 2.10.
The console jar is cached and stored at <playhome>sbt/boot/. After clearing my boot directory I started getting the error, so it's all good now (well not good, but we are on the same page at least).
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/i_I6tZ_3QWIJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

peter hausel

unread,
Oct 8, 2012, 10:34:47 PM10/8/12
to play-fr...@googlegroups.com

After some time on the web, I found a solution. I added the following dep to my project:
  "org.specs2" % "specs2_2.10.0-M7" % "1.12.1.1" % "test",

Play core is depending on the same version. However, I just found it out that we pull in a 2.9 jar for template compiler project that may cause the problem for you. Will fix that

Ben McCann

unread,
Oct 8, 2012, 10:41:20 PM10/8/12
to play-fr...@googlegroups.com
Thank you so much for looking at this Peter!

To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/0aLklvYkQx4J.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.



--
about.me/benmccann

peter hausel

unread,
Oct 8, 2012, 10:43:57 PM10/8/12
to play-fr...@googlegroups.com
I take that back, that looks OK actually.

peter hausel

unread,
Oct 8, 2012, 11:14:54 PM10/8/12
to play-fr...@googlegroups.com
The console issue is now fixed ( https://github.com/playframework/Play20/commit/286b0f4eef56c26f35992995d354d2d16b6b18ad )
you'd need to delete your cache (<playhome>/framework/sbt/boot/scala-2.9.2/play or something like that) and rebuild play to get it working.

Ben McCann

unread,
Oct 9, 2012, 12:06:40 AM10/9/12
to play-fr...@googlegroups.com
Thanks Peter. That allowed me to create an example which reproduces the problem I'm having:


To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/ZGqeKfdVQTkJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Reply all
Reply to author
Forward
0 new messages