Open transentia opened 2 years ago
I wonder if this arises from my SecurityInterceptor (excerpted):
@CompileStatic
@Slf4j
class SecurityInterceptor {
...
boolean before() {
final isLoggedIn = session['userid'] && session['role']
log.debug("{}/{}; isLoggedIn: {}", controllerName, actionName, isLoggedIn)
if (! isLoggedIn) {
// save where we were trying to get to for use in AuthController if login is successful
**session['filter'] = [controller: controllerName ?: 'home', action: actionName, params: params] as Map**
redirect controller: 'auth', action: 'login', params: params
}
isLoggedIn
}
...
}
I'm not sure I see any (reasonable) alternative to putting params into the session.
It seems to me that GrailsParameterMap should be serializable...for this use-case.
I'm also surprised that Tomcat doesn't complain.
My workaround:
// Jetty complains that params is not serializable...
// Make a proper serializable map to use instead...a nice, simple workaround...:
Map ppp = [:]
ppp.putAll(params)
session['filter'] = [controller: controllerName ?: 'home', action: actionName, params: ppp] as Map
Seems to do the job.
Expected Behavior
I have a fully working application that has always used Tomcat. Thought I'd see if Jetty would give me a bit more performance. Converted my build by referencing https://github.com/puneetbehl/grails-jetty-example NO source changes outside build.gradle. Expected no problems. It seems to work so far, but I get MANY warnings on each page view about "java.io.NotSerializableException: grails.web.servlet.mvc.GrailsParameterMap"
Indeed:
Actual Behaviour
I get:
I note taht this is only a WARN and I could probably just silence this in my logback config but it is unexpected, gives me a feeling of uncertainty and may kill the performance that is my justification for using Jetty.
Steps To Reproduce
No response
Environment Information
Windows 11 Java openjdk-18.0.2.1_windows-x64_bin Grails 5.2.3
Example Application
No response
Version
5.2.3