相关疑难解决方法(0)

Groovy Mixins?

我正在尝试在我的Groovy/Grails应用程序中混合使用一个类,并且我正在使用文档中定义的语法,但我一直收到错误.

我有一个看起来像这样的域类:

class Person {
  mixin(ImagesMixin)

  // ...
}
Run Code Online (Sandbox Code Playgroud)

编译很好,但由于某种原因,它将无法正常工作.包含ImagesMixin的文件位于我的/src/groovy/目录中.

我试过使用Groovy版本1.5.7和1.6-RC1没有任何运气.有谁知道我做错了什么?

堆栈跟踪:

2008-12-30 17:58:25.258::WARN:  Failed startup of context org.mortbay.jetty.webapp.WebAppContext@562791{/FinalTransmission,/home/kuccello/Development/workspaces/lifeforce/FinalTransmission/web-app}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
    at java.security.AccessController.doPrivileged(Native Method)
    at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy:67)
    at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy)
    at Init_groovy$_run_closure6.doCall(Init_groovy:131)
    at RunApp_groovy$_run_closure2.doCall(RunApp_groovy:66)
    at RunApp_groovy$_run_closure2.doCall(RunApp_groovy)
    at RunApp_groovy$_run_closure1.doCall(RunApp_groovy:57)
    at RunApp_groovy$_run_closure1.doCall(RunApp_groovy)
    at gant.Gant.dispatch(Gant.groovy:271)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.processTargets(Gant.groovy:436)
    at gant.Gant.processArgs(Gant.groovy:372)
Caused by: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at …
Run Code Online (Sandbox Code Playgroud)

grails groovy mixins

10
推荐指数
3
解决办法
9715
查看次数

标签 统计

grails ×1

groovy ×1

mixins ×1