Problem with vert.x example

Hi

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(Class.java:2404)   at java.lang.Class.getConstructor0(Class.java:2714)   at java.lang.Class.newInstance0(Class.java:343)   at java.lang.Class.newInstance(Class.java:325)   at org.vertx.java.deploy.impl.java.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:63)   at org.vertx.java.deploy.impl.VerticleManager$2.run(VerticleManager.java:271)   at org.vertx.java.core.impl.DefaultVertx$2.run(DefaultVertx.java:251)   at org.vertx.java.core.impl.Context$2.run(Context.java:113)   at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processEventQueue(AbstractNioWorker.java:360)   at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:244)   at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:38)   at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)   at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)   at java.lang.Thread.run(Thread.java:722)

My simple code is here

import org.vertx.java.deploy.Verticle import org.vertx.java.core.http.HttpServerRequest import org.vertx.java.core.Handler

public class HelloServer() : Verticle() {
  public override fun start() {
  val server = vertx?.createHttpServer()!!
  server.requestHandler(object : Handler<HttpServerRequest?> {
           public override fun handle(req : HttpServerRequest?) {
           req?.response?.end(“Hello”)
           }
  })
  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...

Hello,

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 :)