Problem with 1.6.2.2 version

6 views
Skip to first unread message

Tim Nelson

unread,
Nov 5, 2010, 5:23:24 PM11/5/10
to specs-users
Hi,

We recently updated the Scala 2.7 branch of Lift with version 1.6.2.2
and this is now causing an odd error in one of our tests. This same
code runs fine on the 2.8 branch with 1.6.5.

To reproduce the error you'll need to clone the master_2.7 branch of
Lift. You'll also need MongoDB installed and running. The tests are
skipped if you don't have MongoDB running. I'd be willing to test a
patched version of Specs if you need me to.

The code in question is this file [1] on line 336. GitHub shows it as
line 342. The full stack trace is below.

Note that I'll probably be updating the master_2.7 branch soon to
revert back to 1.6.2.1, so make sure you have the proper version set
in resources/lift-parent/pom.xml

Thanks,
Tim

1 -
https://github.com/lift/lift/blob/master_2.7/framework/lift-persistence/lift-mongodb-record/src/test/scala/net/liftweb/mongodb/record/CustomSerializersSpecs.scala

Stacktrace:

-------------------------------------------------------------------------------
Test set: net.liftweb.mongodb.record.CustomSerializersSpecsTest
-------------------------------------------------------------------------------
Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.321
sec <<< FAILURE!
CustomSerializers should hanlde ObjectId as ObjectId values in
JsonObjects using ObjectIdSerializer Time elapsed: 0.003 sec <<<
ERROR!
org.specs.runner.UserError: java.lang.NoClassDefFoundError: net/
liftweb/http/js/JE$JsObj
at java.lang.Class.getDeclaringClass(Native Method)
at java.lang.Class.getEnclosingClass(Class.java:1085)
at java.lang.Class.getSimpleBinaryName(Class.java:1220)
at java.lang.Class.getSimpleName(Class.java:1112)
at org.specs.util.Classes$class.className(Classes.scala:159)
at org.specs.util.Classes$.className(Classes.scala:27)
at org.specs.util.Classes$class.getClassName(Classes.scala:168)
at org.specs.util.Classes$.getClassName(Classes.scala:27)
at org.specs.matcher.AnyBaseMatchers$$anon$2.apply(AnyMatchers.scala:
91)
at org.specs.specification.Expectable.executeMatch$1(Expectable.scala:
101)
at org.specs.specification.Expectable.applyMatcher(Expectable.scala:
116)
at org.specs.specification.Expectation.must(Expectable.scala:172)
at org.specs.specification.Expectation.mustEqual(Expectable.scala:
205)
at net.liftweb.mongodb.record.CustomSerializersSpecs$$anonfun$1$
$anonfun$apply$52.apply(CustomSerializersSpecs.scala:336)
at net.liftweb.mongodb.record.CustomSerializersSpecs$$anonfun$1$
$anonfun$apply$52.apply(CustomSerializersSpecs.scala:304)
at org.specs.specification.LifeCycle
$class.withCurrent(ExampleLifeCycle.scala:60)
at org.specs.specification.Examples.withCurrent(Examples.scala:52)
at org.specs.specification.Examples$$anonfun$specifyExample
$1.apply(Examples.scala:111)
at org.specs.specification.Examples$$anonfun$specifyExample
$1.apply(Examples.scala:111)
at org.specs.specification.ExampleExecution$$anonfun$3$$anonfun$apply
$5.apply(ExampleLifeCycle.scala:212)
at scala.Option.getOrElse(Option.scala:61)
at org.specs.specification.LifeCycle
$class.executeExpectations(ExampleLifeCycle.scala:82)
at
org.specs.specification.BaseSpecification.executeExpectations(BaseSpecification.scala:
57)
at org.specs.specification.LifeCycle$$anonfun$executeExpectations
$1.apply(ExampleLifeCycle.scala:82)
at org.specs.specification.LifeCycle$$anonfun$executeExpectations
$1.apply(ExampleLifeCycle.scala:82)
at scala.Option.map(Option.scala:70)
at org.specs.specification.LifeCycle
$class.executeExpectations(ExampleLifeCycle.scala:82)
at
org.specs.specification.BaseSpecification.executeExpectations(BaseSpecification.scala:
57)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
at scala.Option.map(Option.scala:70)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$class.id
$1(ExampleContext.scala:32)
at org.specs.specification.ExampleContext$$anonfun
$1.apply(ExampleContext.scala:33)
at org.specs.specification.ExampleContext$$anonfun
$1.apply(ExampleContext.scala:33)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3.apply(ExampleContext.scala:80)
at scala.Option.map(Option.scala:70)
at org.specs.specification.ExampleContext
$class.executeExpectations(ExampleContext.scala:80)
at
org.specs.specification.Examples.executeExpectations(Examples.scala:
52)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
at scala.Option.map(Option.scala:70)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$class.id
$1(ExampleContext.scala:32)
at org.specs.specification.ExampleContext$$anonfun
$1.apply(ExampleContext.scala:33)
at org.specs.specification.ExampleContext$$anonfun
$1.apply(ExampleContext.scala:33)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3.apply(ExampleContext.scala:81)
at org.specs.specification.ExampleContext$$anonfun$executeExpectations
$3.apply(ExampleContext.scala:80)
at scala.Option.map(Option.scala:70)
at org.specs.specification.ExampleContext
$class.executeExpectations(ExampleContext.scala:80)
at
org.specs.specification.Examples.executeExpectations(Examples.scala:
52)
at org.specs.specification.ExampleExecution$$anonfun
$3.apply(ExampleLifeCycle.scala:212)
at org.specs.specification.ExampleExecution$$anonfun
$3.apply(ExampleLifeCycle.scala:191)
at org.specs.specification.ExampleExecution$$anonfun
$2.apply(ExampleLifeCycle.scala:174)
at
org.specs.specification.ExampleExecution.execute(ExampleLifeCycle.scala:
245)
at org.specs.specification.SpecificationExecutor$$anonfun
$executeExample$2.apply(SpecificationExecutor.scala:56)
at org.specs.specification.SpecificationExecutor$$anonfun
$executeExample$2.apply(SpecificationExecutor.scala:56)
at scala.Option.map(Option.scala:70)
at org.specs.specification.SpecificationExecutor
$class.executeExample(SpecificationExecutor.scala:56)
at
org.specs.specification.BaseSpecification.executeExample(BaseSpecification.scala:
57)
at
org.specs.specification.BaseSpecification.executeExample(BaseSpecification.scala:
57)
at org.specs.specification.ExampleLifeCycle$$anonfun$executeExample
$1.apply(ExampleLifeCycle.scala:118)
at org.specs.specification.ExampleLifeCycle$$anonfun$executeExample
$1.apply(ExampleLifeCycle.scala:118)
at scala.Option.map(Option.scala:70)
at org.specs.specification.ExampleLifeCycle
$class.executeExample(ExampleLifeCycle.scala:118)
at org.specs.specification.Examples.executeExample(Examples.scala:52)
at org.specs.specification.Examples.executeExample(Examples.scala:52)
at org.specs.specification.Examples$$anonfun$executeExamples
$1.apply(Examples.scala:80)
at org.specs.specification.Examples$$anonfun$executeExamples
$1.apply(Examples.scala:80)
at scala.Option.map(Option.scala:70)
at org.specs.specification.Examples.executeExamples(Examples.scala:
80)
at org.specs.specification.ExampleStructure
$class.ownSkipped(ExampleStructure.scala:60)
at org.specs.specification.Examples.ownSkipped(Examples.scala:52)
at org.specs.runner.ExampleTestCase.run(JUnit.scala:204)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.specs.runner.JUnitSuite$class.run(JUnit.scala:61)
at org.specs.runner.ExamplesTestSuite.run(JUnit.scala:166)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.specs.runner.JUnitSuite$class.run(JUnit.scala:61)
at org.specs.runner.JUnit4.run(JUnit.scala:137)
at org.specs.runner.JUnitSuiteRunner.run(JUnitSuiteRunner.scala:45)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:
59)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:
120)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:
103)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:
350)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:
1021)
Caused by: java.lang.ClassNotFoundException: net.liftweb.http.js.JE
$JsObj
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 96 more


etorreborre

unread,
Nov 5, 2010, 7:23:34 PM11/5/10
to specs-users
Hi Tim,

I think I already saw that issue happening before.

There's nothing I can do generically against that except stop calling
the Class.getSimpleName method which seems to be broken in some cases
with Scala 2.7.7 and specs.
I'm still using getSimpleName in 2.8.0 but it seems to have been
fixed.

I would propose that either:

- We try to understand why the JsObj class fails to be loaded (because
I think this is what's triggering the NoClassDefFoundError). Maybe
this can be resolved by changing the packaging scheme?

- I change the implementation specs to cook my own getSimpleName
method based on getName

Eric.


On Nov 6, 8:23 am, Tim Nelson <tnell...@gmail.com> wrote:
> Hi,
>
> We recently updated the Scala 2.7 branch of Lift with version 1.6.2.2
> and this is now causing an odd error in one of our tests. This same
> code runs fine on the 2.8 branch with 1.6.5.
>
> To reproduce the error you'll need to clone the master_2.7 branch of
> Lift. You'll also need MongoDB installed and running. The tests are
> skipped if you don't have MongoDB running. I'd be willing to test a
> patched version of Specs if you need me to.
>
> The code in question is this file [1] on line 336. GitHub shows it as
> line 342. The full stack trace is below.
>
> Note that I'll probably be updating the master_2.7 branch soon to
> revert back to 1.6.2.1, so make sure you have the proper version set
> in resources/lift-parent/pom.xml
>
> Thanks,
> Tim
>
> 1 -https://github.com/lift/lift/blob/master_2.7/framework/lift-persisten...
>
> Stacktrace:
>
> --------------------------------------------------------------------------- ----
> Test set: net.liftweb.mongodb.record.CustomSerializersSpecsTest
> --------------------------------------------------------------------------- ----

etorreborre

unread,
Nov 5, 2010, 9:02:57 PM11/5/10
to specs-users
Hi Tim,

I uploaded a version of 1.6.2.2 trying to fix the issue you had:

http://nexus-direct.scala-tools.org/content/repositories/snapshots/org/scala-tools/testing/specs/1.6.2.2-SNAPSHOT

Thanks for telling me if it work ok for you now.

E.

On Nov 6, 8:23 am, Tim Nelson <tnell...@gmail.com> wrote:
> Hi,
>
> We recently updated the Scala 2.7 branch of Lift with version 1.6.2.2
> and this is now causing an odd error in one of our tests. This same
> code runs fine on the 2.8 branch with 1.6.5.
>
> To reproduce the error you'll need to clone the master_2.7 branch of
> Lift. You'll also need MongoDB installed and running. The tests are
> skipped if you don't have MongoDB running. I'd be willing to test a
> patched version of Specs if you need me to.
>
> The code in question is this file [1] on line 336. GitHub shows it as
> line 342. The full stack trace is below.
>
> Note that I'll probably be updating the master_2.7 branch soon to
> revert back to 1.6.2.1, so make sure you have the proper version set
> in resources/lift-parent/pom.xml
>
> Thanks,
> Tim
>
> 1 -https://github.com/lift/lift/blob/master_2.7/framework/lift-persisten...
>
> Stacktrace:
>
> --------------------------------------------------------------------------- ----
> Test set: net.liftweb.mongodb.record.CustomSerializersSpecsTest
> --------------------------------------------------------------------------- ----
> org.specs.specification.BaseSpecification.executeExample(BaseSpecification. scala:
> 57)
>         at
> org.specs.specification.BaseSpecification.executeExample(BaseSpecification. scala:
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(A bstractDirectoryTestSuite.java:
> 120)
>         at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Abstract DirectoryTestSuite.java:

Tim Nelson

unread,
Nov 6, 2010, 7:49:46 AM11/6/10
to specs...@googlegroups.com
I just built the entire Lift project with this version and everything
worked fine.

Thanks.

Tim

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

Reply all
Reply to author
Forward
0 new messages