Details
Description
If you try to use a formRemote tag on Google AppEngine it will function correctly on the development server however you will get the following exception in the logs on the actual production server.
[inadition/5.334872088869876828].<stderr>: java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on private final char[] java.lang.String.value
It took a while but I believe the problem is in the JavascriptTagLib.groovy (line 394).
def jsParams = attrs.params?.findAll { it.value instanceof JavascriptValue }
jsParams?.each { attrs.params?.remove(it.key) }
The formRemote is actually passing in params as a String, in order to function on AppEngine you need to wrap this with a check:
def jsParams = [:]
if(attrs.params instanceof Map) {
jsParams = attrs.params?.findAll { it.value instanceof JavascriptValue }
jsParams?.each { attrs.params?.remove(it.key) }
}
"java.lang.IllegalAccessException: Reflection is not allowed" messages seem to be thrown in several places in the Tag libs. Similar exceptions are thrown for g:form and g:submitToRemote. As Philip mentions, these errors are not seen when running the development server locally. Only when deploying an application to GAE. The latter considers these errors critical and does not let the application run. Mine keeps giving me 500 errors.