3

プロジェクトでグリフォン/グレイル/グルービーのコツをつかもうとしています。

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
4

2 に答える 2

3

スレッドアノテーションを使用しているので、コントローラーにgriffon.transform.Threadingをインポートする必要があります。

package test1

import griffon.util.GriffonNameUtils as GNU
import griffon.transform.Threading 

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')
            )
    }

}    
于 2013-01-29T15:08:27.817 に答える
0

アプリケーションの署名はデフォルトで行われます。がrun-webapp呼び出されると、署名は から取得されgriffon-app/conf/BuildConfig.groovyます。この署名は、開発中の実行時に自己署名されたものです。たとえば、次の出力は、構成を変更せずに開発で webstart モードを実行しているフォームです。

Welcome to Griffon 1.2.0 - http://griffon-framework.org/
Licensed under Apache Standard License 2.0
Griffon home is set to: /usr/local/griffon

Base Directory: /private/tmp/test1
Running script /usr/local/griffon/scripts/RunWebstart.groovy
Resolving dependencies...
Dependencies resolved in 857ms.
Environment set to development
Resolving framework plugin dependencies ...
Framework plugin dependencies resolved in 1495 ms.
Resolving plugin dependencies ...
Plugin dependencies resolved in 807 ms.
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/classes/cli
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/classes/main
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/classes/test
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/test-classes
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/test-resources
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/resources
 [griffonc] Compiling 8 source files to /Users/aalmiray/.griffon/1.2.0/projects/test1/classes/main
 [griffonc] Compiling 3 source files to /Users/aalmiray/.griffon/1.2.0/projects/test1/classes/main
    [mkdir] Created dir: /private/tmp/test1/dist/webstart
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/resources/griffon-app/i18n
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/resources/griffon-app/resources
     [copy] Copying 2 files to /Users/aalmiray/.griffon/1.2.0/projects/test1/resources/griffon-app/i18n
     [copy] Copying 8 files to /Users/aalmiray/.griffon/1.2.0/projects/test1/resources/griffon-app/resources
     [copy] Copying 1 file to /Users/aalmiray/.griffon/1.2.0/projects/test1/classes/main
     [copy] Copying 11 files to /Users/aalmiray/.griffon/1.2.0/projects/test1/resources
     [copy] Copied 8 empty directories to 8 empty directories under /Users/aalmiray/.griffon/1.2.0/projects/test1/resources
Auto-generating a local self-signed key
   [genkey] Generating Key for development
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/groovy-all-2.0.6.jar to /private/tmp/test1/staging/groovy-all-2.0.6.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/griffon-rt-1.2.0.jar to /private/tmp/test1/staging/griffon-rt-1.2.0.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/slf4j-api-1.7.2.jar to /private/tmp/test1/staging/slf4j-api-1.7.2.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/log4j-1.2.17.jar to /private/tmp/test1/staging/log4j-1.2.17.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/slf4j-log4j12-1.7.2.jar to /private/tmp/test1/staging/slf4j-log4j12-1.7.2.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/jcl-over-slf4j-1.7.2.jar to /private/tmp/test1/staging/jcl-over-slf4j-1.7.2.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/jul-to-slf4j-1.7.2.jar to /private/tmp/test1/staging/jul-to-slf4j-1.7.2.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/griffon-swing-runtime-1.2.0.jar to /private/tmp/test1/staging/griffon-swing-runtime-1.2.0.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
      [jar] Building jar: /private/tmp/test1/staging/test1.jar
   [delete] Deleting directory /Users/aalmiray/.griffon/1.2.0/projects/test1/resources/griffon-app/resources
    [mkdir] Created dir: /Users/aalmiray/.griffon/1.2.0/projects/test1/resources/griffon-app/resources
     [copy] Copying 1 file to /private/tmp/test1/staging
  [signjar] Signing JAR: /private/tmp/test1/staging/test1.jar to /private/tmp/test1/staging/test1.jar as development
  [signjar] Warning: 
  [signjar] The signer certificate will expire within six months.
  [signjar] Enter Passphrase for keystore: Enter key password for development: 
     [copy] Copying 11 files to /private/tmp/test1/staging
     [copy] Copying 18 files to /private/tmp/test1/dist/webstart
     [copy] Copied 3 empty directories to 2 empty directories under /private/tmp/test1/dist/webstart
      [zip] Building zip: /private/tmp/test1/dist/webstart/test1-0.1-webstart.zip

net.sourceforge.jnlp.LaunchExceptionあなたが投稿したスタック トレースで気付くことができませんでした。JDK が提供するものとは別の JNLP ランチャーを使用していますか? また、実行の出力は何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.6.0_37 (Apple Inc. 20.12-b01-434)
      OS: Mac OS X 10.7.5 x86_64
于 2013-01-29T21:23:29.413 に答える