ldaley / grails-remote-control

Facilitates executing commands (closures) against remote or local Grails applications
Apache License 2.0
23 stars 16 forks source link

Doesn't work for geb tests if app context is '/' #8

Closed alxndrsn closed 10 years ago

alxndrsn commented 11 years ago

remote-control does not work in Geb tests if app context is set to ROOT.

With the following set in application.properties:

app.context=/

I receive this exception:

| Failure:  setup can be loaded via a remote closure(wsmocker.RemoteConfigLoadSpec)
|  groovyx.remote.RemoteControlException: Error sending command chain to 'http://localhost:8080//grails-remote-control'
    at groovyx.remote.transport.http.HttpTransport.send(HttpTransport.groovy:65)
    at groovyx.remote.client.RemoteControl.sendCommandChain(RemoteControl.groovy:114)
    at groovyx.remote.client.RemoteControl.exec(RemoteControl.groovy:73)
    at groovyx.remote.client.RemoteControl.exec(RemoteControl.groovy:67)
    at wsmocker.RemoteConfigLoadSpec.setup can be loaded via a remote closure(RemoteConfigLoadSpec.groovy:25)
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080//grails-remote-control
    at groovyx.remote.transport.http.HttpTransport.send_closure1(HttpTransport.groovy:62)
    at groovyx.remote.transport.http.HttpTransport.send(HttpTransport.groovy:53)
    ... 4 more

To work around the bug, remove the app.context config from application.properties and instead put the following in grails-app/conf/Config.groovy:

grails.app.context = '/'
environments {
    test {
        grails.app.context = 'workaround'
    }
}
ldaley commented 11 years ago

Can you remember what Grails version you were using?

alxndrsn commented 11 years ago

Almost certainly 2.0.3; otherwise likely 2.2.3.

ldaley commented 10 years ago

There's nothing remote can really do here. This is a bug in Grails.