vert-x3 / vertx-lang-ruby

Vert.x Ruby support
Apache License 2.0
14 stars 12 forks source link

Unknown param type converter should return the Java delegate if possible #29

Closed tsegismont closed 6 years ago

tsegismont commented 7 years ago

utils.to_object should return object.j_del if possible, instead of object

For example, trying to send a Buffer over the event bus ends with:

GRAVE: io.vertx.core.impl.ContextImpl - Unhandled exception 
java.lang.IllegalArgumentException: No message codec for type: class org.jruby.RubyObjectVar0
    at io.vertx.core.eventbus.impl.CodecManager.lookupCodec(io/vertx/core/eventbus/impl/CodecManager.java:90)
    at io.vertx.core.eventbus.impl.EventBusImpl.createMessage(io/vertx/core/eventbus/impl/EventBusImpl.java:229)
    at io.vertx.core.eventbus.impl.EventBusImpl.send(io/vertx/core/eventbus/impl/EventBusImpl.java:110)
    at io.vertx.core.eventbus.impl.EventBusImpl.send(io/vertx/core/eventbus/impl/EventBusImpl.java:95)
    at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
    at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
    at org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)
    at org.jruby.RubyMethod.call(org/jruby/RubyMethod.java:119)
    at org.jruby.RubyMethod$INVOKER$i$call.call(org/jruby/RubyMethod$INVOKER$i$call.gen)
    at RUBY.send(uri:classloader:/vertx/event_bus.rb:62)
    at RUBY.block in testSendBuffer(uri:classloader:/event_bus_test.rb:19)
    at RUBY.block in completion_handler(uri:classloader:/vertx/message_consumer.rb:115)
    at org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
    at org.jruby.RubyProc.call(org/jruby/RubyProc.java:246)
    at org.jruby.javasupport.Java$ProcToInterface.callProc(org/jruby/javasupport/Java.java:1112)
    at org.jruby.javasupport.Java$ProcToInterface.access$300(org/jruby/javasupport/Java.java:1089)
    at org.jruby.javasupport.Java$ProcToInterface$ConcreteMethod.call(org/jruby/javasupport/Java.java:1150)
    at io.vertx.core.eventbus.impl.HandlerRegistration.lambda$completionHandler$1(io/vertx/core/eventbus/impl/HandlerRegistration.java:97)
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(io/vertx/core/impl/ContextImpl.java:344)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(io/netty/util/concurrent/AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(io/netty/util/concurrent/SingleThreadEventExecutor.java:403)
    at io.netty.channel.nio.NioEventLoop.run(io/netty/channel/nio/NioEventLoop.java:445)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(io/netty/util/concurrent/SingleThreadEventExecutor.java:858)
    at java.lang.Thread.run(java/lang/Thread.java:748)
tsegismont commented 7 years ago

Similar to vert-x3/vertx-lang-js#68