-
-
Notifications
You must be signed in to change notification settings - Fork 964
Open
Description
This commit introduced biding exceptions on several methods in my Controller, but not all of them.
Summary
Inconstant binding resulting in GroovyCastExceptions
class ContestController {
def dq(long id, long imageId) {} // WORKS FINE!
def submit(long id, long images) {} // GroovyCastException: Cannot cast object '1000311' with class 'java.lang.String' to class 'long'
def prepareQuestionnaire(Long id) { // GroovyCastException: Cannot cast object '1000271' with class 'java.lang.String' to class 'java.lang.Long'
}
this worked fine until August 7th
class ContestController {
def submit(long images) { params.long('id')}
}
results in
2025-10-16T10:15:25.907-07:00 ERROR 69893 --- [cat-handler-402]
o.g.web.errors.GrailsExceptionResolver : Cannot cast object '1000311' with class 'java.lang.String' to class 'long'
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '1000311' with class 'java.lang.String' to class
'long'
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
which is weird because there is not a complete stack trace.
Workaround:
class ContestController {
def submit(long id, long images) {}
}
No response
Example Application
I am unable to replicate this in an example app and there are other similar situations in my app that work fine.
Version
7.0.0
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status