java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

122 views
Skip to first unread message

Davi Souza

unread,
Oct 29, 2013, 12:12:17 PM10/29/13
to ve...@googlegroups.com
Hello, 

error when i run: vertx run last.groovy -cp httpbuilder-0.5.2.jar

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

what is wrong?

my verticle:

import groovyx.net.http.RESTClient
 
def uri = "my_DB/_design/event/_view/last"
def query = [reduce:true, group:true]

def response = new RESTClient("http://test_01:5984").get(
path         : uri
,contentType : "application/json" //when I run without this line, the error does not occur => out: 200
,query       : query)

println response.status

Jon Keys

unread,
Oct 30, 2013, 10:18:14 AM10/30/13
to ve...@googlegroups.com
I believe this will create a blocking HTTP GET request. You shouldn't do this in a "normal" verticle / module (blocking is OK in a worker module but for something like this you'd ideally use non-blocking libraries).
You probably want to use the vert.x HttpClient (http://vertx.io/core_manual_groovy.html#writing-http-clients).

I know this doesn't actually answer your original question but I hope it gets you on the right path.
 
Reply all
Reply to author
Forward
0 new messages