grails 2.5+;在控制器上实现serializable时出现重复类定义错误

grails 2.5+;在控制器上实现serializable时出现重复类定义错误,grails,Grails,升级grails的遗留系统。其中一个控制器实现可序列化。这会在较新版本的grails中引发以下错误: Invalid duplicate class definition of class com.regional.ScheduleController : The source contains at least two definitions of the class. One of the classes is an explicit generated class using the

升级grails的遗留系统。其中一个控制器实现可序列化。这会在较新版本的grails中引发以下错误:

Invalid duplicate class definition of class com.regional.ScheduleController : 
The source contains at least two definitions of the class. 
One of the classes is an explicit generated class using the class statement, 
the other is a class generated from the script body based on the file name. 
Solutions are to change the file name or to change the class name.
提到的解决方案将打破(以前的)grails惯例。有人知道如何在Grails2.5+中处理这个问题吗

编辑

可序列化不是问题所在。我试图删除它,但得到了相同的错误。 我从以下方面找到了这种解释:

然而,这并不能解释为什么它在Grails2.5之下运行良好,而在Grails2.5之上运行不好。我在控制器中找不到像上面提到的那样的def冲突

回答
其中一个导入实际上失败了——导致groovy基于当前文件名生成类定义。当它击中类定义时,已经有一个自动生成的类名要与之冲突

为什么控制器需要可序列化?我相信它正在实现可序列化,以便与它使用的JasperReports功能一起工作。我尝试删除serializable,但错误保持不变。。。。
IN groovy.. class B{} is a class structure and defines a class B. 
Scripts are classes too.
 Now you may create a B.groovy, with the content "class B{}; def b = new B()". 
There would be one class named B, and a script with the very same name.
This is a conflict.