play-plugins icon indicating copy to clipboard operation
play-plugins copied to clipboard

java.lang.VerifyError: Bad type on operand stack

Open slmnhq opened this issue 10 years ago • 3 comments

In my Play! app, I'm inlcuding the latest version of the plugin:

"com.typesafe" %% "play-plugins-redis" % "2.2.1"

When I do sbt run to run my Play app, the following traceback is observed:

play.api.PlayException: Cannot load plugin[Plugin [com.typesafe.plugin.RedisPlugin] cannot be instantiated.]
    at play.api.WithDefaultPlugins$$anonfun$plugins$1$$anonfun$apply$9.apply(Application.scala:159) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.WithDefaultPlugins$$anonfun$plugins$1$$anonfun$apply$9.apply(Application.scala:128) ~[play_2.10-2.2.2.jar:2.2.2]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library.jar:na]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library.jar:na]
    at scala.collection.immutable.List.foreach(List.scala:318) ~[scala-library.jar:na]
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) ~[scala-library.jar:na]
    at scala.collection.AbstractTraversable.map(Traversable.scala:105) ~[scala-library.jar:na]
    at play.api.WithDefaultPlugins$$anonfun$plugins$1.apply(Application.scala:128) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.WithDefaultPlugins$$anonfun$plugins$1.apply(Application.scala:164) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.WithDefaultPlugins$class.plugins(Application.scala:126) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.DefaultApplication.plugins$lzycompute(Application.scala:399) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.DefaultApplication.plugins(Application.scala:399) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.Play$$anonfun$start$1.apply(Play.scala:88) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.Play$$anonfun$start$1.apply(Play.scala:88) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.api.Play$.start(Play.scala:87) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:139) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:112) ~[play_2.10-2.2.2.jar:2.2.2]
    at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:112) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:110) ~[play_2.10-2.2.2.jar:2.2.2]
    at scala.util.Success.flatMap(Try.scala:200) ~[scala-library.jar:na]
    at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.10-2.2.2.jar:2.2.2]
    at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:102) ~[play_2.10-2.2.2.jar:2.2.2]
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[scala-library.jar:na]
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[scala-library.jar:na]
    at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) ~[scala-library.jar:na]
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) ~[scala-library.jar:na]
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) ~[scala-library.jar:na]
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) ~[scala-library.jar:na]
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) ~[scala-library.jar:na]
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    com/typesafe/plugin/RedisPlugin.jedisPool$lzycompute()Lredis/clients/jedis/JedisPool; @79: invokespecial
  Reason:
    Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[3]) is not assignable to 'org/apache/commons/pool/impl/GenericObjectPool$Config'
  Current Frame:
    bci: @79
    flags: { }
    locals: { 'com/typesafe/plugin/RedisPlugin', 'com/typesafe/plugin/RedisPlugin', 'redis/clients/jedis/JedisPoolConfig' }
    stack: { 'com/typesafe/plugin/RedisPlugin', uninitialized 54, uninitialized 54, 'redis/clients/jedis/JedisPoolConfig', 'java/lang/String', integer, integer, 'java/lang/String', integer }
  Bytecode:
    0000000: 2a59 4cc2 2ab4 0021 1040 7e03 a000 542a
    0000010: 2a2a b400 23b7 00a3 4db2 00a9 bb00 ab59
    0000020: 2ab7 00ac b600 b0b2 00a9 bb00 b259 2a2c
    0000030: b700 b5b6 00b0 bb00 b759 2c2a b600 b92a
    0000040: b600 bb2a b600 bd2a b700 bf2a b600 c1b7
    0000050: 00c4 b500 c62a 2ab4 0021 1040 80b5 0021
    0000060: b200 4857 2bc3 2ab4 00c6 b02b c3bf
  Exception Handler Table:
    bci [4, 102] => handler: 107
  Stackmap Table:
    append_frame(@96,Object[#2])
    same_locals_1_stack_item_frame(@107,Object[#80])

    at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.7.0_55]
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493) ~[na:1.7.0_55]
    at java.lang.Class.getConstructor0(Class.java:2803) ~[na:1.7.0_55]
    at java.lang.Class.getConstructor(Class.java:1718) ~[na:1.7.0_55]
    at play.api.WithDefaultPlugins$$anonfun$plugins$1$$anonfun$apply$9.apply(Application.scala:130) ~[play_2.10-2.2.2.jar:2.2.2]
    ... 32 common frames omitted

As you may have noticed, I'm using Scala 2.10 and Play 2.2.2.

Any help would be appreciated.

slmnhq avatar Aug 05 '14 16:08 slmnhq

I'm having exactly the same problem. I'm using Play version 2.3.7

On a side note, it has been frustrating to start using the Redis plugin, because the provided example uses the outdated Build.scala. The template I started with uses the now preferred build.sbt. The README says:

add play = 2.3.x: "com.typesafe.play.plugins" %% "play-plugins-redis" % "2.3.1" to your dependencies

Being new to Play, I had no idea how to do this. Different examples use addSbtPlugin, libraryDependencies, appDependencies in various different files. I finally found this SO post that helped. Now I'm compiling, but when I run the app and hit the endpoint I get something like the error pasted in this issue:

Cannot load plugin Plugin [com.typesafe.plugin.RedisPlugin] cannot be instantiated. No source available, here is the exception stack trace: ->java.lang.VerifyError: Bad type on operand stack Exception Details: Location: com/typesafe/plugin/RedisPlugin.jedisPool$lzycompute()Lredis/clients/jedis/JedisPool; @79: invokespecial Reason: Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[3]) is not assignable to 'org/apache/commons/pool/impl/GenericObjectPool$Config' Current Frame: bci: @79 flags: { } locals: { 'com/typesafe/plugin/RedisPlugin', 'com/typesafe/plugin/RedisPlugin', 'redis/clients/jedis/JedisPoolConfig' } stack: { 'com/typesafe/plugin/RedisPlugin', uninitialized 54, uninitialized 54, 'redis/clients/jedis/JedisPoolConfig', 'java/lang/String', integer, integer, 'java/lang/String', integer } Bytecode: 0x0000000: 2a59 4cc2 2ab4 0021 1040 7e03 a000 542a 0x0000010: 2a2a b400 23b7 00a3 4db2 00a9 bb00 ab59 0x0000020: 2ab7 00ac b600 b0b2 00a9 bb00 b259 2a2c 0x0000030: b700 b5b6 00b0 bb00 b759 2c2a b600 b92a 0x0000040: b600 bb2a b600 bd2a b700 bf2a b600 c1b7 0x0000050: 00c4 b500 c62a 2ab4 0021 1040 80b5 0021 0x0000060: b200 4857 2bc3 2ab4 00c6 b02b c3bf
Exception Handler Table: bci [4, 102] => handler: 107 Stackmap Table: append_frame(@96,Object[#2]) same_locals_1_stack_item_frame(@107,Object[#80]) java.lang.Class.getDeclaredConstructors0(Native Method)

tony-bye avatar Feb 12 '15 02:02 tony-bye

The above errors are from the webpage. From the console:

! @6l6ije61p - Internal server error, for (GET) [/] ->

@6l6ije61p: Cannot load plugin at play.api.WithDefaultPlugins$$anonfun$plugins$1$$anonfun$apply$9.apply(Application.scala:161) at play.api.WithDefaultPlugins$$anonfun$plugins$1$$anonfun$apply$9.apply(Application.scala:130) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at play.api.WithDefaultPlugins$$anonfun$plugins$1.apply(Application.scala:130) at play.api.WithDefaultPlugins$$anonfun$plugins$1.apply(Application.scala:166) at play.utils.Threads$.withContextClassLoader(Threads.scala:21) at play.api.WithDefaultPlugins$class.plugins(Application.scala:128) at play.api.DefaultApplication.plugins$lzycompute(Application.scala:402) at play.api.DefaultApplication.plugins(Application.scala:402) at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91) at play.api.Play$$anonfun$start$1.apply(Play.scala:91) at play.api.Play$$anonfun$start$1.apply(Play.scala:91) at play.utils.Threads$.withContextClassLoader(Threads.scala:21) at play.api.Play$.start(Play.scala:90) at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:157) at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:130) at scala.Option.map(Option.scala:145) at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:130) at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:128) at scala.util.Success.flatMap(Try.scala:200) at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:128) at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:120) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: com/typesafe/plugin/RedisPlugin.jedisPool$lzycompute()Lredis/clients/jedis/JedisPool; @79: invokespecial Reason: Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[3]) is not assignable to 'org/apache/commons/pool/impl/GenericObjectPool$Config' Current Frame: bci: @79 flags: { } locals: { 'com/typesafe/plugin/RedisPlugin', 'com/typesafe/plugin/RedisPlugin', 'redis/clients/jedis/JedisPoolConfig' } stack: { 'com/typesafe/plugin/RedisPlugin', uninitialized 54, uninitialized 54, 'redis/clients/jedis/JedisPoolConfig', 'java/lang/String', integer, integer, 'java/lang/String', integer } Bytecode: 0x0000000: 2a59 4cc2 2ab4 0021 1040 7e03 a000 542a 0x0000010: 2a2a b400 23b7 00a3 4db2 00a9 bb00 ab59 0x0000020: 2ab7 00ac b600 b0b2 00a9 bb00 b259 2a2c 0x0000030: b700 b5b6 00b0 bb00 b759 2c2a b600 b92a 0x0000040: b600 bb2a b600 bd2a b700 bf2a b600 c1b7 0x0000050: 00c4 b500 c62a 2ab4 0021 1040 80b5 0021 0x0000060: b200 4857 2bc3 2ab4 00c6 b02b c3bf
Exception Handler Table: bci [4, 102] => handler: 107 Stackmap Table: append_frame(@96,Object[#2]) same_locals_1_stack_item_frame(@107,Object[#80])

at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2663)

tony-bye avatar Feb 12 '15 02:02 tony-bye

Is there a solution for this issue? @slmnhq @tony-bye Please help

niteshchaudhary avatar Oct 20 '16 02:10 niteshchaudhary