我正在尝试为一个项目掌握 griffon/grails/groovy 的窍门。
我在编译时从我的 Test1Controller.groovy 文件中收到此错误:
[griffonc] /home/ironmantis7x/griffon_projects/test1/griffon-app/controllers/test1/Test1Controller.groovy: 14: unable to resolve class Threading , unable to find class for annotation
[griffonc] @ line 14, column 5.
[griffonc] @Threading(Threading.Policy.SKIP)
[griffonc] ^
[griffonc]
[griffonc] /home/ironmantis7x/griffon_projects/test1/griffon-app/controllers/test1/Test1Controller.groovy: 14: unable to find class 'Threading.Policy.SKIP' for annotation attribute constant
[griffonc] @ line 14, column 16.
[griffonc] @Threading(Threading.Policy.SKIP)
[griffonc] ^
[griffonc]
[griffonc] 2 errors
Compilation error: Compilation Failed
这是我的控制器文件:
package test1
import griffon.util.GriffonNameUtils as GNU
class Test1Controller {
def model
def clear = {
model.griffonClass.propertyNames.each { name -> model[name] = ''
}
}
@Threading(Threading.Policy.SKIP)
def submit = {
java.swing.JoptionPane.showMessageDialog(
app.windowManager.windows.find{it.focused},
model.griffonClass.propertyNames.collect([]) {
name -> "${GNU.getNaturalName(name)} = ${model[name]}"
}.join('n')
)
}
}
就像我说我是 griffon/grails/groovy 的新手 - 有人可以帮助我了解我似乎缺少什么吗?
谢谢!
铁螳螂7x
我做了下面建议的更改,现在运行时出现此错误:griffon run-webstart -clean:
net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize application.
at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:778)
at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:552)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:889)
Caused by: net.sourceforge.jnlp.LaunchException: Fatal: Application Error: Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed.
at net.sourceforge.jnlp.runtime.JNLPClassLoader.setSecurity(JNLPClassLoader.java:312)
at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:232)
at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:357)
at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:330)
at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:770)
... 2 more
如何签署应用程序以克服此错误?
这是我运行 griffon -version 的配置:
------------------------------------------------------------
Griffon 1.2.0
------------------------------------------------------------
Build: 11-Jan-2013 09:10 AM
Groovy: 2.0.6
Ant: 1.8.4
Slf4j: 1.7.2
Spring: 3.2.0.RELEASE
JVM: 1.7.0_09 (Oracle Corporation 23.2-b09)
OS: Linux 3.5.0-22-generic amd64