[Java-2.5.0-RC2] ClassCastException: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo

1,427 views
Skip to first unread message

Sam Walker

unread,
Feb 27, 2016, 2:02:02 PM2/27/16
to play-framework

I am getting this ClassCastException, no idea where is this generated from.

java.lang.ClassCastException: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo

at javassist.bytecode.ConstPool.getMethodrefType(ConstPool.java:452)

at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:800)

at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)

at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)

at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)

at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199)

at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199)

at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)

at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)

at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)

at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)

at javassist.expr.ExprEditor.doit(ExprEditor.java:113)

at javassist.CtBehavior.instrument(CtBehavior.java:712)

at play.core.enhancers.PropertiesEnhancer.rewriteAccess(PropertiesEnhancer.java:154)

at com.typesafe.play.sbt.enhancer.PlayEnhancer$$anonfun$scopedSettings$4.apply(PlayEnhancer.scala:44)

at com.typesafe.play.sbt.enhancer.PlayEnhancer$$anonfun$scopedSettings$4.apply(PlayEnhancer.scala:44)

at scala.Function2$$anonfun$curried$1$$anonfun$apply$1.apply(Function2.scala:45)

at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)

at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)

at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)

at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)

at scala.collection.AbstractTraversable.filter(Traversable.scala:105)

at com.typesafe.play.sbt.enhancer.PlayEnhancer$$anonfun$bytecodeEnhance$1$$anonfun$apply$2.apply(PlayEnhancer.scala:71)

at com.typesafe.play.sbt.enhancer.PlayEnhancer$$anonfun$bytecodeEnhance$1$$anonfun$apply$2.apply(PlayEnhancer.scala:48)

at com.typesafe.play.sbt.enhancer.PlayEnhancer$$anonfun$scopedSettings$2.apply(PlayEnhancer.scala:38)

at com.typesafe.play.sbt.enhancer.PlayEnhancer$$anonfun$scopedSettings$2.apply(PlayEnhancer.scala:34)

at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)

at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)

at sbt.std.Transform$$anon$4.work(System.scala:63)

at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)

at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)

at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)

at sbt.Execute.work(Execute.scala:237)

at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)

at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)

at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)

at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

[error] (compile:manipulateBytecode) java.lang.ClassCastException: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo

Igmar Palsenberg

unread,
Feb 29, 2016, 2:31:34 AM2/29/16
to play-framework


Op zaterdag 27 februari 2016 20:02:02 UTC+1 schreef Sam Walker:

I am getting this ClassCastException, no idea where is this generated from.

 

at play.core.enhancers.PropertiesEnhancer.rewriteAccess(PropertiesEnhancer.java:154)

at com.typesafe.play.sbt.enhancer.PlayEnhancer$$anonfun$scopedSettings$4.apply(PlayEnhancer.scala:44)



Looks like this is coming from the enhancer plugin. You're sure the version referenced matches your Play version ?


Igmar 

Eric Cobos Sanchez

unread,
Mar 10, 2016, 9:50:55 AM3/10/16
to play-framework
Hi, I'm having exactly the same error, I've updated play to 2.5.0 and I don't have explicitly the enhancer plugin, instead I'm using the sbt-play-ebean plugin that includes the enhancer by default. My plugins.sbt looks like:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.6")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")

and my build.sbt:


name := "xxxxxxx"

version := "1.1"

lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
javaJdbc,
cache,
javaWs,
"com.typesafe.akka" %% "akka-actor" % "2.4.2",
"org.apache.httpcomponents" % "httpcore" % "4.2.3",
"org.mockito" % "mockito-all" % "1.9.5",
"org.scalatest" % "scalatest_2.11" % "2.2.0" % "test",
"org.easymock" % "easymock" % "3.2" % "test",
"com.typesafe.akka" %% "akka-testkit" % "2.3.9",
"com.voodoodyne.jackson.jsog" % "jackson-jsog" % "1.1"
)

libraryDependencies += "junit" % "junit" % "4.11" % "test"
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
libraryDependencies += "com.mandrillapp.wrapper.lutung" % "lutung" % "0.0.5"
libraryDependencies += "org.json" % "json" % "20141113"
libraryDependencies += "org.testng" % "testng" % "6.9.4"
libraryDependencies += "com.amazonaws" % "aws-java-sdk" % "1.10.4"
libraryDependencies += "com.tngtech.java" % "junit-dataprovider" % "1.9.4"

fork in Test := true
javaOptions in Test += "-Dconfig.file=/var/lib/caveeapi/testConfig.conf"

routesGenerator := StaticRoutesGenerator


I really will appreciate a lot any help, because I'm not able to compile properly my application.
Thanks

Igmar Palsenberg

unread,
Mar 10, 2016, 12:30:44 PM3/10/16
to play-framework
 
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")

This version is not for 2.5, but for 2.4. For 2.5, you need to use 1.1.0


Igmar

Eric Cobos Sanchez

unread,
Mar 11, 2016, 8:40:59 AM3/11/16
to play-framework
I've tried the 1.1.0 and it shows as unresolved dependency, I also tried the 3.0.0-SNAPSHOT (the one that I found in the play 2.5.0 ebean config) and I also have unresolved dependency. Searching in groups I found one answer that says that it worked with 3.0.0-M1, and it works, but sometimes have strange behaviours (it sometimes didn't update fields).
What is the correct sbt-play-ebean version to use with 2.5.0?

Many thanks in advance.

Igmar Palsenberg

unread,
Mar 11, 2016, 8:56:12 AM3/11/16
to play-framework


Op vrijdag 11 maart 2016 14:40:59 UTC+1 schreef Eric Cobos Sanchez:
I've tried the 1.1.0 and it shows as unresolved dependency, I also tried the 3.0.0-SNAPSHOT (the one that I found in the play 2.5.0 ebean config) and I also have unresolved dependency. Searching in groups I found one answer that says that it worked with 3.0.0-M1, and it works, but sometimes have strange behaviours (it sometimes didn't update fields).
What is the correct sbt-play-ebean version to use with 2.5.0?

Doesn't 3.0.0 work ? The project does have that version tagged.



Igmar

Joseph Lust

unread,
Apr 27, 2017, 12:05:31 PM4/27/17
to Play Framework
Had the same problem when building with the most recent Play-Enhancer in Central (1.1.0) and Play v2.6.0-M6.

We don't use Java interop in our code any more, so I just removed Enhancer and compilation worked again.

--Joe

Joseph Lust

unread,
Apr 27, 2017, 3:11:31 PM4/27/17
to Play Framework
Correction, I meant Play v2.6.0-M4, M6 isn't out yet. ;)

-J
Reply all
Reply to author
Forward
0 new messages