Problem with vert.x example



I was trying to say hello world in vert.x with kotlin (aka kert.x), but failed with the following error:

java.lang.VerifyError: (class: HelloServer, method: start signature: ()V) Bad access to protected data   at java.lang.Class.getDeclaredConstructors0(Native Method)   at java.lang.Class.privateGetDeclaredConstructors(   at java.lang.Class.getConstructor0(   at java.lang.Class.newInstance0(   at java.lang.Class.newInstance(   at   at$   at$   at$   at   at   at   at   at org.jboss.netty.util.internal.DeadLockProofWorker$   at java.util.concurrent.ThreadPoolExecutor.runWorker(   at java.util.concurrent.ThreadPoolExecutor$   at

My simple code is here

import import import

public class HelloServer() : Verticle() {
  public override fun start() {
  val server = vertx?.createHttpServer()!!
  server.requestHandler(object : Handler<HttpServerRequest?> {
           public override fun handle(req : HttpServerRequest?) {
  server.listen(8080, “localhost”)

I ran it with

vertx run HelloServer -cp ~/.m2/repository/org/jetbrains/kotlin/kotlin-runtime/0.1-SNAPSHOT/kotlin-runtime-0.1-SNAPSHOT.jar:~/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/0.1-SNAPSHOT/kotlin-stdlib-0.1-SNAPSHOT.jar:.

It seemed that vertx can not run the constructor. I have no idea how to deal with this...



I’ve just created KT-2060 which you can subscribe to monitor.


Thanks :) so for now I'll just use it in the default package :)