ldaley / grails-remote-control

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

remote control not available when using catch-all URL mapping #9

Closed alxndrsn closed 10 years ago

alxndrsn commented 11 years ago

Not sure if this is grails-remote-control's fault, but with a catch-all URL mapping like so:

class UrlMappings {
    static mappings = {
        "/**"(controller:'boss')
    }
}

I get the following exception:

|  groovyx.remote.RemoteControlException: Error sending command chain to 'http://localhost:8080/wsmocker/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/wsmocker/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

The fix is to add the following line to URL Mappings:

static excludes = ['/grails-remote-control']

so it looks like this:

class UrlMappings {
    static excludes = ['/grails-remote-control']
    static mappings = {
        "/**"(controller:'boss')
    }
}

Again, I'm not sure if this can be fixed in grails-remote-control, but I think it's worth mentioning as the excludes options is not mentioned in the grails documentation, and it could be tricky to figure this out.

ldaley commented 10 years ago

This isn't something that we can fix, but a note in the docs would be great.

Would you mind submitting a pull request to the readme?

alxndrsn commented 10 years ago

Sure thing.

ldaley commented 10 years ago

Thanks for the docs!

This is in 1.5.

alxndrsn commented 10 years ago

Mega, thanks.