Hi everyone, I'm trying to upgrade our application...
# questions
t
Hi everyone, I'm trying to upgrade our application from Grails 6.1.2 to 6.2.0 (using JDK 11), and I'm getting an error about this line of code at the beginning of a controller method:
Copy code
List<Long> longIds = ((String) params.ids)?.split(',')?.collect { String id -> id.toLong() }
List<SessionItemGroup> sessionItemGroups = SessionItemGroup.getAll(longIds)
SessionItemGroup
is a domain class. The error is
Copy code
399: [Static type checking] - Cannot call com.example.sessionitem.SessionItemGroup#getAll(java.lang.Iterable <java.io.Serializable>) with arguments [java.util.List <java.lang.Long>]
 @ line 399, column 56.
   temGroup> sessionItemGroups = SessionIte
Does anyone know how to fix this error?
j
@tylervz What version of Groovy are you using? It looks very similar to https://issues.apache.org/jira/browse/GROOVY-7985 which was fixed prior to 3.0 release and all the way back to 2.4.18+
t
Whatever the default version of Groovy is that's used by Grails 6.2.0, I think. How do I check that?
j
You can look at external libraries in IntelliJ or similar location in other IDEs and look for org.codehaus.groovy:groovy.
If it will start you can also use:
Copy code
GroovySystem.getVersion()
t
I added the
@CompileDynamic
annotation to the controller method so I could start the application and check the output of
GroovySystem.getVersion()
, which is returning
"3.0.21"
j
Glad you got it solved with the other feedback.