Compilation Problems with 1.6.1: class file needed by Suite/Matchers is missing

168 views
Skip to first unread message

Ryan Neufeld

unread,
Jun 21, 2011, 1:46:21 PM6/21/11
to scalatest-users
I am attempting to compile the following dummy test in a Play! project
with Scala 2.9.0.1 and ScalaTest 1.6.1 and I am encountering
compilation errors.

If anyone has any advice it would be greatly appreciated.

-Ryan

The test:


import play._
import play.test._

import org.scalatest._
import org.scalatest.junit._
import org.scalatest.matchers._

class BasicTests extends UnitFlatSpec with ShouldMatchers {
it should "run this dumb test" in {
(1 + 1) should be (2)
}
}


And I receive the following errors:


play.exceptions.CompilationException: error while loading Suite, class
file needed by Suite is missing.
reference type serializable of package annotation refers to
nonexisting symbol.
at play.scalasupport.ScalaPlugin$ScalaCompiler$$anon
$1.info0(ScalaPlugin.scala:224)
at play.scalasupport.ScalaPlugin$ScalaCompiler$$anonfun$compile
$1.apply$mcV$sp(ScalaPlugin.scala:383)
at play.scalasupport.ScalaPlugin$ScalaCompiler$$anonfun$compile
$1.apply(ScalaPlugin.scala:383)
at play.scalasupport.ScalaPlugin$ScalaCompiler$$anonfun$compile
$1.apply(ScalaPlugin.scala:383)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
...

and


play.exceptions.UnexpectedException: Unexpected Error
at play.Play.start(Play.java:491)
at play.Play.detectChanges(Play.java:563)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
Caused by: java.io.IOException: class file needed by Matchers is
missing.
reference type Serializable of package scala refers to nonexisting
symbol.
at scala.reflect.generic.UnPickler
$Scan.errorMissingRequirement(UnPickler.scala:754)
at scala.reflect.generic.UnPickler$Scan.readSymbol(UnPickler.scala:
194)
at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef
$1.apply(UnPickler.scala:708)
at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef
$1.apply(UnPickler.scala:708)
at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:150)
...

Ryan Neufeld

unread,
Jun 21, 2011, 4:26:03 PM6/21/11
to scalatest-users
I should also note my Java version is
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)

Bill Venners

unread,
Jun 21, 2011, 4:41:56 PM6/21/11
to scalate...@googlegroups.com
Hi Ryan,

I'm having trouble reproducing this, because I can't even get play off
the ground anymore. It was working before I tried going back to 1.5
this morning. Coming back to 1.5 doesn't seem to help. I'm getting:

Listening for transport dt_socket at address: 8000
13:38:18,011 INFO ~ Starting
/Users/bv/nobkp/delus/playWithPlay/tryit/myScalaWebapp
13:38:18,014 INFO ~ Module scala is available
(/usr/artima/play-1.2.2RC2/modules/scala-0.9.1)
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad
version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)


I'll try reinstalling play and its Scala support from scratch.

Bill

> --
> You received this message because you are subscribed to the Google
> Groups "scalatest-users" group.
> To post to this group, send email to scalate...@googlegroups.com
> To unsubscribe from this group, send email to
> scalatest-use...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/scalatest-users?hl=en
> ScalaTest itself, and documentation, is available here:
> http://www.artima.com/scalatest
>

--
Bill Venners
Artima, Inc.
http://www.artima.com

Bill Venners

unread,
Jun 21, 2011, 4:43:00 PM6/21/11
to scalate...@googlegroups.com
Hi Ryan,

Which versions of play and the play Scala plugin are you using?

Bill

On Tue, Jun 21, 2011 at 10:46 AM, Ryan Neufeld <ry...@gushhq.com> wrote:

Ryan Neufeld

unread,
Jun 21, 2011, 4:43:10 PM6/21/11
to scalate...@googlegroups.com
Ouch, well let me know if there is anything I can do to help on my end. I appreciate the attention.

-- 
Ryan Neufeld
Sent with Sparrow

Ryan Neufeld

unread,
Jun 21, 2011, 4:44:32 PM6/21/11
to scalatest-users
Play 1.2.1 with scala 0.9

Bill Venners

unread,
Jun 21, 2011, 5:15:21 PM6/21/11
to scalate...@googlegroups.com
Hi Ryan,

OK. I'll try those versions, but I may be blocked. I tried
redownloading Play 1.2.2RC2 and Scala plugin 0.9.1 and I get the same
exception. I may have to reinstall the OS, and I can't do that until
later this week, as I am on a trip. The one thing I would like to try,
which perhaps you could try if you don't mind, is to use Scala 2.9.0
instead of 2.9.0-1. 2.9.0-1 is supposed to be binary compatible with
2.9.0, but what you're seeing is something missing in the Scala
library. So just to make sure it isn't that, the trick would be to try
it with Scala 2.9.0 and see if you get the same error. Can you give
that a try while I wrestle with Apple Java pains?

Thanks.

Bill

Ryan Neufeld

unread,
Jun 21, 2011, 5:33:43 PM6/21/11
to scalatest-users
Installed and tried with 2.9.0.final and the result is the same.

Versions FYI: Scala: 2.9.0.(final/1), Play 1.2.1, Play Scala 0.9

On Jun 21, 4:15 pm, Bill Venners <b...@artima.com> wrote:
> Hi Ryan,
>

Bill Venners

unread,
Jun 21, 2011, 7:01:43 PM6/21/11
to scalate...@googlegroups.com
Hi Ryan,

I'm at an Apple genius bar to see if I can get back to square 1. Will
probably need to reinstall the OS, which would require I do a backup,
and they probably won't load me a drive. Unfortunately I'm on the road
so have limited options. I did have play working before trying to
install Java 1.5 this morning, so I'm pretty sure that screwed it up.

Bill

Bill Venners

unread,
Jun 21, 2011, 7:59:53 PM6/21/11
to scalate...@googlegroups.com
Hi Ryan,

I have yet to get a new play app working, so I can't try this. One
other thing I wanted to try is to use 2.8.1. I'm wondering if Play
requires Scala 2.8.1. It says on this page that "The included Scala
version is 2.8.1," but doesn't say if that's required:

http://scala.playframework.org/documentation/scala-0.9.1/install

If so then ScalaTest 1.6.1 for sure wouldn't work with 0.9.1 of the
play Scala plugin, and likely wouldn't work with the 0.9 version
you're using. You'd need to use ScalaTest 1.5.1.RC1. Would you mind
trying that? If that works, then my best guess is simply that
Play/Scala currently requires Scala 2.8.1.

Sorry I can't try these myself. It should be easy but Apple is making
it complicated.

Bill

Ryan Neufeld

unread,
Jun 21, 2011, 8:02:29 PM6/21/11
to scalate...@googlegroups.com
I'll give it a try as soon as I can. Thanks for giving me something to go on. Here's to hoping it works.

-- 
Ryan Neufeld

On Tuesday, June 21, 2011 at 7:01 PM, Ryan Neufeld wrote:

I'll give it a try tomorrow morning. Thanks for giving 

-- 
Ryan Neufeld

Bill Venners

unread,
Jun 21, 2011, 8:24:17 PM6/21/11
to scalate...@googlegroups.com
Hi Ryan,

I figured out my problem! Had a very old JAVA_HOME set that play was
picking up. It pointed to 1.5 home, which until this morning just
pointed to 1.6, but now is really 1.5.

Did you do anything other than "play test" to get your error message?
When I say "play test" it goes and if I go to
http://localhost:9000/@tests it seems to be running it. I put in
another test that fails and it runs it fine. This is using whatever
ScalaTest version comes with Play/Scala. How did you upgrade to
ScalaTest 1.6.1?

Bill

Ryan Neufeld

unread,
Jun 21, 2011, 8:26:50 PM6/21/11
to scalate...@googlegroups.com
Hey Bill,

I just tried out ScalaTest 1.5 w/ the app and it appears to be working - what you said about the bundled version of Scala was right!

The only thing I'm running into now (much much further down the test toolchain) is a routing error for Play!'s test runner and the jQuery it wants to use (probably unrelated to ScalaTest).

Thanks so much for your help and time.

-- 
Ryan Neufeld

Bill Venners

unread,
Jun 21, 2011, 9:06:58 PM6/21/11
to scalate...@googlegroups.com
Hi Ryan,

Sure no problem. I happened to be trying to move from wicket to
play/Scala for scalatest.org's site. So it was something I needed to
get working anyway. All these version dependencies can be confusing
for sure. Let me know if you have any other problems or insights in
how to use ScalaTest with play.

Bill

Ryan Neufeld

unread,
Jun 21, 2011, 9:08:38 PM6/21/11
to scalate...@googlegroups.com
I'm sure you'll find out how it goes: I imagine there will be many blog posts in the future as I start using Scala/Play and ScalaTest in my day-to-day job.

-- 
Ryan Neufeld

Reply all
Reply to author
Forward
0 new messages