Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.0.1
-
Fix Version/s: 2.0.2
-
Component/s: Build System
-
Labels:None
-
Environment:Grails 2.0.1, Java 1.6, Windows XP
Description
There are 2 wrong behaviours.
1) First, just try to "run-app" for this attached example. You'll get this message:
| Error Compilation error: startup failed: D:\grails\grails-app\controllers\bug\SearchController.groovy: Controller actions may not be overloaded. The [compareTo] action has been overloaded in [bug.SearchCommand]. |
2) Change all references to "private int compareTo(def main, def other)" to "private int compareTo2(def main, def other)" and try to "run-app" again. You'll get this message:
| Warning The [toUrlParams] action in [bug.SearchCommand] accepts a parameter of type [bug.enums.Group] which has not been marked with @grails.validation.Validateable. This may lead to an intermittent MissingMethodException for validate(). We strongly recommend that you mark command object classes with @Validateable in order to avoid the problem. |
String toUrlParams(Group group) {
^
| Compiling 11 source files. |
| Error Compilation error: startup failed: D:\grails\grails-app\controllers\bug\SearchController.groovy: -1: Enum constructor calls are only allowed inside the enum class . At [-1:-1] @ line -1, column -1. 1 error |
-
Hide
- grails.zip
- 15/Feb/12 2:15 PM
- 122 kB
- André Mattos
-
- grails/.classpath 0.7 kB
- grails/.idea/.name 0.0 kB
- grails/.idea/ant.xml 0.2 kB
- grails/.idea/compiler.xml 0.7 kB
- grails/.idea/.../profiles_settings.xml 0.1 kB
- grails/.idea/encodings.xml 0.2 kB
- grails/.idea/misc.xml 11 kB
- grails/.idea/modules.xml 0.4 kB
- grails/.idea/uiDesigner.xml 9 kB
- grails/.idea/vcs.xml 0.3 kB
- grails/.idea/workspace.xml 26 kB
- grails/.project 0.5 kB
- grails/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- grails/application.properties 0.1 kB
- grails/.../ApplicationResources.groovy 0.1 kB
- grails/grails-app/conf/BootStrap.groovy 0.1 kB
- grails/grails-app/.../BuildConfig.groovy 2 kB
- grails/grails-app/conf/Config.groovy 4 kB
- grails/grails-app/conf/DataSource.groovy 1 kB
- grails/grails-app/.../resources.groovy 0.0 kB
- grails/grails-app/.../UrlMappings.groovy 0.2 kB
- grails/.../SearchController.groovy 2 kB
- grails/grails-app/.../messages.properties 3 kB
- grails/.../messages_cs_CZ.properties 3 kB
- grails/grails-app/.../messages_da.properties 3 kB
- grails/grails-app/.../messages_de.properties 4 kB
- grails/grails-app/.../messages_es.properties 3 kB
- grails/grails-app/.../messages_fr.properties 2 kB
- grails/grails-app/.../messages_it.properties 2 kB
- grails/grails-app/.../messages_ja.properties 4 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Oleg,
I believe that we fixed this several weeks ago and the fix should be included in Grails 2.0.2 (which will be released very soon). If you are interested in helping to verify the fix, please grab a snapshot build from http://hudson.grails.org/view/Grails%202.0.x/job/grails_core_2.0.x/lastSuccessfulBuild/artifact/build/distributions/ and give it a spin. If you do, please comment here with the outcome of that.
Thanks.
I was able to simulate this error in a similar scenario (without any command objects) in Grails 2.0.1.
"...action accepts a parameter of type [java.io.File] which does not appear to be a command object class. Command object must be marked with @Validateable".
class MyController {
//....
def list() {
File[] f = new File("c:/mydirectory/").listFiles(
new FilenameFilter() {
boolean accept(File dir, String name)
}
)
f.each
}
}
I tried in Grails 2.0.3 and the error is not there anymore.
Have the same problem