Open kehn opened 12 years ago
I've tested above code, it's still worked with Grails 2.2.1
I have this problem in grails 2.2.3
I have this same problem in grails 2.4.2
def index(Integer max) {
(new RestBuilder()).rest.get("http://localhost:8080/eca-proto-server/api/animal") {
acceptType MediaType.APPLICATION_JSON
}
}
2014-07-08 10:27:12,571 [http-bio-8080-exec-3] ERROR errors.GrailsExceptionResolver - IllegalArgumentException occurred when processing request: [GET] /eca-proto-server/api/animal
URI is not absolute. Stacktrace follows:
Message: URI is not absolute
Line | Method
->> 1095 | toURL in java.net.URI
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 308 | invokeRestTemplate in grails.plugins.rest.client.RestBuilder
| 273 | doRequestInternal in ''
| 261 | doRequestInternal in ''
| 106 | get . . . . . . . in ''
| 17 | index in com.drc.app.v1.AnimalController
| 177 | doFilter . . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 82 | doFilter . . . . . in com.brandseye.cors.CorsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
I'm getting the following stacktrace:
Using this code (snippet):
This error does not happen if I remove the JSON lines and instead I get a plain text response back.