Skip to content

java.lang.VerifyError: Bad type on operand stack #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
coffeeaddict opened this issue Mar 23, 2014 · 6 comments
Closed

java.lang.VerifyError: Bad type on operand stack #24

coffeeaddict opened this issue Mar 23, 2014 · 6 comments

Comments

@coffeeaddict
Copy link

When trying to use this in a ruby-verticle like so:

require 'vertx'

psql_config = {
  address: "db-psql",
  connection: "PostgreSQL",
  maxPoolSize: 5,
  username: "recipebook",
  password: "$uper$ecret",
  database: "recipebooks",
}

Vertx.deploy_module("io.vertx~mod-mysql-postgresql~0.2.0", psql_config)
Vertx.deploy_verticle("server.rb", {}, 4)

where server.rb looks like:

require 'vertx'
require 'pp'

include Vertx

rm = RouteMatcher.new

rm.get('/recipes') do |req|
  EventBus.send("db-psql", { action: :select, table: :recipes }.to_json) do |reply|
    Vertx.logger.info reply.pretty_inspect
    req.response.end(reply.body.to_json)
  end
end

rm.get('/recipes/:id') do |req|
  req.response.status_code(404).end({ error: 'no such book'}.to_json);
end

HttpServer.new.request_handler(rm).listen(8080)

it throws this error:

Unexpected exception in Ruby verticle 
java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    io/vertx/asyncsql/Starter.reportFailure(Ljava/lang/Throwable;)V @2: invokestatic
  Reason:
    Type 'io/vertx/asyncsql/Starter' (current frame, stack[0]) is not assignable to 'org/vertx/scala/core/VertxExecutionContext'
  Current Frame:
    bci: @2
    flags: { }
    locals: { 'io/vertx/asyncsql/Starter', 'java/lang/Throwable' }
    stack: { 'io/vertx/asyncsql/Starter', 'java/lang/Throwable' }
  Bytecode:
    0000000: 2a2b b800 72b1                         

    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
    at java.lang.Class.getConstructor0(Class.java:2803)
    at java.lang.Class.newInstance(Class.java:345)
    at org.vertx.scala.lang.ClassLoaders$$anonfun$newInstance$1.apply(ClassLoaders.scala:38)
    at scala.util.Try$.apply(Try.scala:161)
    at org.vertx.scala.lang.ClassLoaders$.newInstance(ClassLoaders.scala:36)
    at org.vertx.scala.platform.impl.ScalaVerticleFactory.createVerticle(ScalaVerticleFactory.scala:69)
    at org.vertx.java.platform.impl.DefaultPlatformManager$18.run(DefaultPlatformManager.java:1269)
    at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:170)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Thread.java:744)

What is wrong?

@Narigo
Copy link
Member

Narigo commented Mar 26, 2014

Not sure about that yet. Are you using Scala 1.0.0-RC1 in your langs.properties? Can you try with 0.3.0? Maybe that's still an issue. I'm trying to update to Scala 1.0.0-RC1 but have trouble with the new VertxExecutionContext. Hopefully this will be resolved soon.

@coffeeaddict
Copy link
Author

Unexpected exception in Ruby verticle 
java.lang.AbstractMethodError: io.vertx.asyncsql.Starter.setVertx(Lorg/vertx/scala/core/Vertx;)V
    at org.vertx.scala.platform.impl.ScalaVerticle.setVertx(ScalaVerticle.scala:51)
    at org.vertx.scala.platform.impl.ScalaVerticle$.newVerticle(ScalaVerticle.scala:37)
    at org.vertx.scala.platform.impl.ScalaVerticleFactory.createVerticle(ScalaVerticleFactory.scala:72)
    at org.vertx.java.platform.impl.DefaultPlatformManager$18.run(DefaultPlatformManager.java:1269)
    at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:170)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Thread.java:744)

Same thing, different output...

Perhaps mixing and matching this with Ruby is not the best of ideas 😏...

@Narigo
Copy link
Member

Narigo commented Mar 27, 2014

Just to be sure: You've tried Scala lang 0.3.0 and the master branch of this module (0.3.0-SNAPSHOT)?

@coffeeaddict
Copy link
Author

😱 it works now!

Thx for the help; perhaps these learned lessons need a place in the readme? 😉

@angeloh
Copy link

angeloh commented Apr 18, 2014

What is the ETA for this to update to scala lang 1.0.x?

@angeloh
Copy link

angeloh commented Apr 18, 2014

@coffeeaddict do you have to change your module to scala lang 0.3.0 or just postgres mod's scala lang to 0.3.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants