java.lang.VerifyError on RichInt

Showing 1-14 of 14 messages
java.lang.VerifyError on RichInt Bill Atkins 5/13/11 11:25 AM
I just upgraded to Scala 2.9.0 (and the latest 2.9.0-compatible ScalaQuery). When I try to insert a row into a ScalaQuery-mapped table, I get the following error:

Exception in thread "main" java.lang.VerifyError: class scala.runtime.RichInt$$anon$2 overrides final method foreach.(Lscala/Function1;)V
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    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)
    at scala.runtime.RichInt.until(RichInt.scala:25)
    at org.scalaquery.ql.basic.BasicInsertBuilder.f$1(BasicInsertBuilder.scala:32)
    ....

The snippet in ScalaQuery that causes this is in BasicInsertBuilder.scala:

      case p:Projection[_] =>
        for(i <- 0 until p.productArity)
          f(Node(p.productElement(i)))
 

but I don't see any problem there.

The RichInt.until implementation in question is a bridge method:

      @bridge
      def until(end: Int): Range with Range.ByOne = new Range(self, end, 1) with Range.ByOne

Does anyone know what would cause this? If this is more a ScalaQuery issue than a 2.9.0 issue, let me know and I can redirect my question to the ScalaQuery mailing list.

Thanks,
Bill
Re: [scala-user] java.lang.VerifyError on RichInt Paul Phillips 5/13/11 11:32 AM
On 5/13/11 11:25 AM, Bill Atkins wrote:
> I just upgraded to Scala 2.9.0 (and the latest 2.9.0-compatible
> ScalaQuery). When I try to insert a row into a ScalaQuery-mapped table,
> I get the following error:
>
> Exception in thread "main" java.lang.VerifyError: class
> scala.runtime.RichInt$$anon$2 overrides final method
> foreach.(Lscala/Function1;)V

https://lampsvn.epfl.ch/trac/scala/ticket/4575
"java.lang.VerifyError: class scala.runtime.RichInt$$anon$1 overrides final method foreach.(Lscala/Function1;)V"

Re: [scala-user] java.lang.VerifyError on RichInt Bill Atkins 5/13/11 12:32 PM
I see - thanks!
Re: [scala-user] java.lang.VerifyError on RichInt Robbie Coleman 5/18/11 3:30 PM
Just to note that Scala moved from trac to jira so the link to the bug is now:
https://issues.scala-lang.org/browse/SI-4575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Looks like odersky has fixed this compiler bug, but I do not know if such a fix has been released. I am seeing the same runtime exception with Glassfish:


java.lang.VerifyError: class scala.runtime.RichInt$$anon$2 overrides final method foreach.(Lscala/Function1;)V
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:925)
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1485)
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1368)
    at scala.runtime.RichInt.until(RichInt.scala:25)
    at net.liftweb.json.JsonAST$.quote(JsonAST.scala:397)
    at net.liftweb.json.JsonAST$.render(JsonAST.scala:363)
    at net.liftweb.json.JsonAST$$anonfun$3.apply(JsonAST.scala:367)
    at net.liftweb.json.JsonAST$$anonfun$3.apply(JsonAST.scala:367)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)
    at scala.collection.immutable.List.map(List.scala:45)
    at net.liftweb.json.JsonAST$.render(JsonAST.scala:367)
    at net.liftweb.json.JsonAST$$anonfun$2.apply(JsonAST.scala:364)
    at net.liftweb.json.JsonAST$$anonfun$2.apply(JsonAST.scala:364)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)
    at scala.collection.immutable.List.map(List.scala:45)
    at net.liftweb.json.JsonAST$.render(JsonAST.scala:364)
    at net.liftweb.json.JsonAST$$anonfun$3.apply(JsonAST.scala:367)
    at net.liftweb.json.JsonAST$$anonfun$3.apply(JsonAST.scala:367)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)
    at scala.collection.immutable.List.map(List.scala:45)
    at net.liftweb.json.JsonAST$.render(JsonAST.scala:367)
Re: [scala-user] java.lang.VerifyError on RichInt ijuma 5/19/11 2:03 AM
Hi Robbie,

On Wed, May 18, 2011 at 11:30 PM, Robbie Coleman <rob...@robnrob.com> wrote:
> Looks like odersky has fixed this compiler bug, but I do not know if such a
> fix has been released. I am seeing the same runtime exception with
> Glassfish:

The bug was fixed in trunk, but no release includes it yet. What
version of Scala did you use?

Best,
Ismael

Re: [scala-user] java.lang.VerifyError on RichInt Robbie Coleman 5/19/11 2:08 AM
I was using the full release of 2.9.0, but I do see issues with some of our dependencies like lift json and a couple others that have yet to release even a snapshot version built against 2.9.0.

Thanks for the update @Ismael.
Re: [scala-user] java.lang.VerifyError on RichInt ijuma 5/19/11 2:18 AM
On Thu, May 19, 2011 at 10:08 AM, Robbie Coleman <rob...@robnrob.com> wrote:
> I was using the full release of 2.9.0

That has the issue, so it's indeed expected to fail.

> but I do see issues with some of our
> dependencies like lift json and a couple others that have yet to release
> even a snapshot version built against 2.9.0.

lift-json has released a snapshot version built with 2.9.0 a couple of days ago.

Best,
Ismael

Re: [scala-user] java.lang.VerifyError on RichInt martin odersky 5/19/11 8:12 AM
We will push out a maintenance release of 2.9 shortly that contains a fix for this problem as well as a couple of others.

 -- Martin--
----------------------------------------------
Martin Odersky
Prof., EPFL and CEO, Typesafe
PSED, 1015 Lausanne, Switzerland
Tel. EPFL: +41 21 693 6863
Tel. Typesafe: +41 21 691 4967

Re: [scala-user] java.lang.VerifyError on RichInt Sue Hinton 7/20/11 8:46 AM
FYI, just downloaded scala-2.9.0.1 and am getting
    java.lang.NoSuchMethodError: scala.runtime.RichInt.until(I)Lscala/collection/immutable/Range$ByOne;
    at Main$$anon$1$$anonfun$2$$anonfun$apply$4.apply(OverallDelayInfo.scala:112)
at the for-loop line below

        val in = new java.io.FileInputStream(file)
        var lines = Source.fromInputStream(in).getLines.toArray
        //println(file.getName + " has " + lines.length + " lines.")
        in.close
 
        val inHeaderRow = lines(0).split(",")

       for(i <- 0 until inHeaderRow.length)  // exception is thrown at this line

... So I'm reverting to 2.8.0.final.
Re: [scala-user] java.lang.VerifyError on RichInt nafg 7/20/11 9:49 PM
Did you do a clean build?
Re: [scala-user] java.lang.VerifyError on RichInt Sue Hinton 7/21/11 2:27 PM
My code "build" should be clean, as I use a commandline scripting mechanism to run, i.e.,
>  scala MyScript.scala <input params>

The build of scala was downloaded from the web into its own directory, and is used exclusively, so it should be clean.
Re: [scala-user] java.lang.VerifyError on RichInt James Moore 11/9/11 12:16 AM
I think I'm seeing the same thing with 2.9.1 and 2.9.2.  The error I get is:

(using scala-2.9.2.r25964-b20111108042542)
[error] (run-main) java.lang.VerifyError: class com.restphone.IsList$ overrides final method canEqual.(Ljava/lang/Object;)Z
java.lang.VerifyError: class com.restphone.IsList$ overrides final method canEqual.(Ljava/lang/Object;)Z
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

If I rebuild with scala-2.10.0.r25972-b20111109023956 I don't see the problem.
Re: [scala-user] java.lang.VerifyError on RichInt James Moore 11/9/11 12:26 AM

Code at  https://s3.amazonaws.com/teenstarter/Deleteme3.tar.bz2.  It should run with sbt run.  (Warning: the project isn't finished, readable code.  It's a project that I use as a scratch area for experiments.  However, it should repro the stack dump repeatably.)
Re: [scala-user] java.lang.VerifyError on RichInt James Moore 11/9/11 9:39 AM
I submitted a bug -  https://issues.scala-lang.org/browse/SI-5171