圣杯 2.2
所以这应该很容易,但是我不断收到相同的错误消息:
Class java.lang.IllegalArgumentException
Message No enum constant myPackageName.RequestType.Banner
这是我的课:
public enum RequestType {
BANNER("Banner"), OTHER("Other")
final String value
RequestType(String value) { this.value = value }
String toString() { value }
}
这把我逼疯了!!
编辑:堆栈跟踪
No enum constant myPackageName.RequestType.Banner. Stacktrace follows:
java.lang.IllegalArgumentException: No enum constant myPackageName.RequestType.Banner
at java.lang.Enum.valueOf(Enum.java:236)
at org.grails.datastore.gorm.GormStaticApi.methodMissing(GormStaticApi.groovy:108)
at ysuprojects.ProjectService.viewableProjects(ProjectService.groovy:115)
at ysuprojects.ProjectService.getIndexModel(ProjectService.groovy:422)
at ysuprojects.ProjectController.index(ProjectController.groovy:25)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
这是它在课堂上的使用方式
class Project {
...
RequestType requestType
...
}