Having upgraded to Grails 2.3.5 I found my mixins only work when JVM forking is turned off.
All my controllers have code like this
import util.MyMixin
@Mixin(MyMixin)
class MyController {
Where MyMixin
is defined in src/groovy/util
and looks something like
package util
class MyMixin {
private def aMethod(someArgs) {
// do something
}
}
When the BuildConfig.groovy
contains the following code
forkConfig = [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256]
grails.project.fork = [
test: forkConfig, // configure settings for the test-app JVM
run: forkConfig, // configure settings for the run-app JVM
war: forkConfig, // configure settings for the run-war JVM
console: forkConfig // configure settings for the Swing console JVM
]
Then I get the following error
MissingMethodException occurred when processing request:
No signature of method: MyController.aMethod() is applicable for argument types
Where the argument types match and of course the code works when I don't have the JVM forking code in BuildConfig.groovy
.
Is there something special I need to do to get mixins to work when forking the JVM? I'm only using forking because Grails 2.3.5 recommends it and I had problems when I didn't use it: Grails 2.3.5 requiring "grails clean" after every code change