Я создаю новое приложение Grails и делаю grails install-plugin rest
.Сборки приложений.Теперь я добавляю точно пример со страницы плагина: http://grails.org/plugin/rest в загрузчик и получаю:
import l2http.*
class BootStrap {
def init = { servletContext ->
withHttp(uri: "http://www.google.com") {
def html = get(path : '/search', query : [q:'Groovy'])
assert html.HEAD.size() == 1
assert html.BODY.size() == 1
}
}
def destroy = {
}
}
Это вылетает со следующей ошибкой:
| Loading Grails 2.0.0
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Compiling 1 source files.....
| Running Grails application
| Error 2012-03-26 11:41:07,823 [Thread-8] ERROR context.GrailsContextLoader - Error executing bootstraps: groovy.lang.MissingMethodException: No signature of method: grails.util.Environment.withHttp() is applicable for argument types: (java.util.LinkedHashMap, BootStrap$_closure1_closure3) values: [[uri:http://www.google.com], BootStrap$_closure1_closure3@299cc074]
Message: groovy.lang.MissingMethodException: No signature of method: grails.util.Environment.withHttp() is applicable for argument types: (java.util.LinkedHashMap, BootStrap$_closure1_closure3) values: [[uri:http://www.google.com], BootStrap$_closure1_closure3@299cc074]
Line | Method
->> 290 | evaluateEnvironmentSpecificBlock in grails.util.Environment
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 283 | executeForEnvironment in ''
| 259 | executeForCurrentEnvironment . . in ''
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by MissingMethodException: No signature of method: grails.util.Environment.withHttp() is applicable for argument types: (java.util.LinkedHashMap, BootStrap$_closure1_closure3) values: [[uri:http://www.google.com], BootStrap$_closure1_closure3@299cc074]
->> 345 | methodMissing in grails.util.Environment$EnvironmentBlockEvaluator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 4 | doCall in BootStrap$_closure1
| 290 | evaluateEnvironmentSpecificBlock in grails.util.Environment
| 283 | executeForEnvironment in ''
| 259 | executeForCurrentEnvironment . . in ''
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread