読者です 読者をやめる 読者になる 読者になる

リアル幻獣も叫んだGriffon 1.0が登場したので動かしてみた

Groovy Griffon

幻想世界 幻獣事典






とりあえず、WindowsでGriffon 1.0のサンプルを動かしてみた。

実行環境

JAVAFX_HOME=c:\usr\opt\JavaFX\javaFXSDK2.1
JAVA_HOME=C:\usr\opt\java\jdk1.7.0_04

Griffonダウンロード

Download ページ

Griffonの環境設定

解凍

griffon-1.0.0-bin.zip を解凍
READMEが重複してるって警告がでたんだけど・・・

環境変数の設定

GRIFFON_HOME=C:\usr\opt\Griffon\griffon-1.0.0
PATHに GRIFFON_HOME%\bin を追加

躓きそうなところの対処

@、@、@ の3人で、Twitter上でわいわいガヤガヤやってた。
それがここにまとまってるので、これを見て対処してみる。
griffon 1.0.0 でのGroovyFX周りの呟きメモ(Mac)griffon 1.0.0 でのGroovyFX周りの呟きメモ(Win)
Windowsの場合は、with JavaFX 2.1 でも、JDKのインストーラ終了後にJavaFXのインストーラが起動して別にインストールする。
jfxrt.jarも%JAVAFX_HOME%\rt\lib\jfxrt.jar にある。



プラグインのインストール


バッチファイルにするなら、call つけてね。

JAVA_HOMEとJAVAFX_HOMEの確認
C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyFxPad>set java
JAVAFX_HOME=c:\usr\opt\JavaFX\javaFXSDK2.1
JAVA_HOME=C:\usr\opt\java\jdk1.7.0_04

GroovyFxPadの実行

[C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyFxPad]griffon run-app
Welcome to Griffon 1.0.0 - http://griffon-framework.org/
Licensed under Apache Standard License 2.0
Griffon home is set to: C:\usr\opt\Griffon\griffon-1.0.0

Base Directory: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyFxPad
Running script C:\usr\opt\Griffon\griffon-1.0.0\scripts\RunApp.groovy
Resolving dependencies...
Dependencies resolved in 811ms.
Environment set to development
Resolving framework plugin dependencies ...
Framework plugin dependencies resolved in 696 ms.
Resolving plugin dependencies ...
Plugin dependencies resolved in 3158 ms.
Launching application ...
2012-06-09 17:29:17,453 [main] INFO  griffon.swing.SwingApplication - Initializing all startup groups: [ide]
Device "Intel(R) HD Graphics 3000" (\\.\DISPLAY1) initialization failed :
WARNING: bad driver version detected, device disabled. Please update your driver to at least version 8.15.10.2302
Device "Intel(R) HD Graphics 3000" (\\.\DISPLAY2) initialization failed :
WARNING: bad driver version detected, device disabled. Please update your driver to at least version 8.15.10.2302

GroovyFXPadに付属のサンプル実行

Script>Smaples>GroovyFX>Hello GroovyFX を実行


いやっほぉぉGroovy!!



FileViewerの実行



FxBrowserの実行



WeatherWidgetの実行


すけすけ

FontPickerの実行

トラブルチューティングに書いたプラグインをインスールをして起動


SwingPadの実行

トラブルチューティングに書いたプラグインをインスールをして起動

SwingPadに付属のサンプルJide - Flairを実行

Script > Samples > Builders > Jide - Flair


GroovyEdit実行

トラブルチューティングに書いた @kimukou2628 の修正版コードで起動



その他のサンプル

@kimukou2628 からコメントあり。ありがとうございます!!

  • Greetは起動するけど、ログインボタンをクリックでエラー

これAtom時代のTwログインのままなんですね(今はTwitterはOAuth形式)。

o( ̄ー ̄;)ゞううむ




もっと具体的な話は、第 7 回 JavaFX 勉強会 LT: Griffon での JavaFX 2.1 利用事例
で、@ がきっと話してくれるだろう。




トラブルシューティング

のGroovyFXPadを実行でMISSING
  • 現象
[C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyFxPad]griffon run-app
Welcome to Griffon 1.0.0 - http://griffon-framework.org/
Licensed under Apache Standard License 2.0
Griffon home is set to: C:\usr\opt\Griffon\griffon-1.0.0

It looks like you're running Griffon 1.0.0 for the first time
Please wait a few moments while Griffon configures itself.

     [copy] Copying 1 resource to C:\Users\ORANGE~1\AppData\Local\Temp\griffon-bundles
    [unjar] Expanding: C:\Users\ORANGE~1\AppData\Local\Temp\griffon-bundles\griffon-default-bundles.jar into C:\Users\ORANGE~1\AppData\Local\Temp\griffon-bundles

Uploading plugin griffon-swing-1.0.0-release.zip to griffon-local
Uploading archetype griffon-jumpstart-1.3-release.zip to griffon-local
Uploading archetype griffon-presentation-1.1-release.zip to griffon-local
Uploading archetype griffon-swt-1.0-release.zip to griffon-local

Installing archetype jumpstart-1.3
Software license of jumpstart-1.3 is 'Apache Software License 2.0'
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\archetypes\jumpstart-1.3
    [unzip] Expanding: C:\Users\orangeclover\.griffon\repository\archetypes\jumpstart\1.3\griffon-jumpstart-1.3.zip into C:\Users\orangeclover\.griffon\1.0.0\archetypes\jumpstart-1.3
Installed archetype 'jumpstart-1.3' in C:\Users\orangeclover\.griffon\1.0.0\archetypes/jumpstart-1.3
Installing archetype presentation-1.1
Software license of presentation-1.1 is 'Apache Software License 2.0'
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\archetypes\presentation-1.1
    [unzip] Expanding: C:\Users\orangeclover\.griffon\repository\archetypes\presentation\1.1\griffon-presentation-1.1.zip into C:\Users\orangeclover\.griffon\1.0.0\archetypes\presentation-1.1
Installed archetype 'presentation-1.1' in C:\Users\orangeclover\.griffon\1.0.0\archetypes/presentation-1.1
Installing archetype swt-1.0
Software license of swt-1.0 is 'Apache Software License 2.0'
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\archetypes\swt-1.0
    [unzip] Expanding: C:\Users\orangeclover\.griffon\repository\archetypes\swt\1.0\griffon-swt-1.0.zip into C:\Users\orangeclover\.griffon\1.0.0\archetypes\swt-1.0
Installed archetype 'swt-1.0' in C:\Users\orangeclover\.griffon\1.0.0\archetypes/swt-1.0
   [delete] Deleting directory C:\Users\ORANGE~1\AppData\Local\Temp\griffon-bundles

Done.

Base Directory: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyFxPad
Running script C:\usr\opt\Griffon\griffon-1.0.0\scripts\RunApp.groovy
Resolving dependencies...
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\ant-1.8.2.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\ant-launcher-1.8.2.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\ant-junit-1.8.2.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\jansi-1.7.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\jline-0.9.94.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\commons-io-2.1.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\commons-lang-2.6.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\commons-codec-1.6.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\commons-collections-3.2.1.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\commons-beanutils-1.8.0.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\httpcore-4.1.2.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\httpclient-4.1.2.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\jsch-0.1.45.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\jzlib-1.0.7.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\http-builder-0.5.2.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\xercesImpl-2.9.1.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\ezmorph-1.0.6.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\xml-resolver-1.2.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\dist\griffon-cli-1.0.0.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\dist\griffon-scripts-1.0.0.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\dist\griffon-rt-1.0.0.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\org.springframework.core-3.1.1.RELEASE.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\org.springframework.beans-3.1.1.RELEASE.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\org.springframework.context-3.1.1.RELEASE.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\org.springframework.context.support-3.1.1.RELEASE.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\json-lib-2.4-jdk15.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\log4j-1.2.16.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\slf4j-api-1.6.4.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\slf4j-log4j12-1.6.4.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\jcl-over-slf4j-1.6.4.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\jul-to-slf4j-1.6.4.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\groovy-all-1.8.6.jar
Download complete.
Dependencies resolved in 905ms.
Environment set to development
Resolving framework plugin dependencies ...
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\junit-4.10.jar
Download complete.
Downloading: C:\usr\opt\Griffon\griffon-1.0.0\lib\hamcrest-core-1.1.jar
Download complete.
Framework plugin dependencies resolved in 809 ms.
Resolving plugin dependencies ...
Some dependencies have conflicts.
-= INSTALLED =-

-= MISSING =-
+ installer-0.6 from griffon-central
+ swingx-builder-0.6 from griffon-central
! dialogs-0.3 from griffon-central
   ! glazedlists-0.9 from griffon-central
      ! swing-0.9.5 from griffon-central
   ! miglayout-0.4 from griffon-central
      ! swing-0.9.5 from griffon-central
   ! actions-0.4 from griffon-central
      + i18n-support-0.2 from griffon-central
      ! swing-0.9.5 from griffon-central
+ jide-builder-0.7 from griffon-central
! syntaxtext-0.2 from griffon-central
   ! swing-0.9.5 from griffon-central
! swing-1.0.0 from griffon-local
! silkicons-0.3 from griffon-central
   ! swing-0.9.5 from griffon-central
+ groovyfx-0.6 from griffon-central
Could not resolve plugin dependencies.
  • 原因
    • プラグインが合っていない
対処
    • プラグインのインストール



のGroovyFXPadを実行でNoClassDefFoundError: javafx.collections.ObservableSet
  • 現象
Launching application ...
2012-06-09 17:01:19,097 [main] INFO  griffon.swing.SwingApplication - Initializing all startup groups: [ide]
2012-06-09 17:01:22,864 [main] ERROR griffon.util.GriffonExceptionHandler - Uncaught Exception
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: javafx.collections.ObservableSet
        at org.codehaus.griffon.runtime.core.DefaultMVCGroupManager.initializeMembers(DefaultMVCGroupManager.java:234)
        at org.codehaus.griffon.runtime.core.DefaultMVCGroupManager.buildMVCGroup(DefaultMVCGroupManager.java:147)
        at org.codehaus.griffon.runtime.core.AbstractMVCGroupManager.createMVCGroup(AbstractMVCGroupManager.java:238)
        at org.codehaus.griffon.runtime.core.AbstractMVCGroupManager.createMVCGroup(AbstractMVCGroupManager.java:186)
        at org.codehaus.griffon.runtime.core.AbstractGriffonApplication.createMVCGroup(AbstractGriffonApplication.java:474)
        at org.codehaus.griffon.runtime.core.AbstractGriffonApplication.startup(AbstractGriffonApplication.java:313)
        at griffon.swing.AbstractSwingGriffonApplication.realize(AbstractSwingGriffonApplication.java:78)
        at griffon.swing.AbstractSwingGriffonApplication.run(AbstractSwingGriffonApplication.java:132)
        at griffon.swing.SwingApplication.main(SwingApplication.java:36)
Caused by: java.lang.NoClassDefFoundError: javafx.collections.ObservableSet
        at groovyx.javafx.GroovyFXEnhancer$_enhanceClasses_closure1_closure32.class$(GroovyFXEnhancer.groovy)
        at groovyx.javafx.GroovyFXEnhancer$_enhanceClasses_closure1_closure32.$get$$class$javafx$collections$ObservableSet(GroovyFXEnhancer.groovy)
        at groovyx.javafx.GroovyFXEnhancer$_enhanceClasses_closure1_closure32.doCall(GroovyFXEnhancer.groovy:51)
        at groovyx.javafx.GroovyFXEnhancer.enhanceClasses(GroovyFXEnhancer.groovy:58)
        at groovyx.javafx.GroovyFXEnhancer$enhanceClasses.call(Unknown Source)
        at groovyx.javafx.SceneGraphBuilder.<clinit>(SceneGraphBuilder.groovy:80)
        at griffon.samples.groovyfxpad.IdeController.class$(IdeController.groovy)
        at griffon.samples.groovyfxpad.IdeController.$get$$class$groovyx$javafx$SceneGraphBuilder(IdeController.groovy)
        at griffon.samples.groovyfxpad.IdeController.mvcGroupInit(IdeController.groovy:54)
        ... 9 more
  • 原因
    • JavaFX2.0.Xになっているため
FontPicker
[C:\usr\opt\Griffon\griffon-1.0.0\samples\FontPicker]griffon run-app
Welcome to Griffon 1.0.0 - http://griffon-framework.org/
Licensed under Apache Standard License 2.0
Griffon home is set to: C:\usr\opt\Griffon\griffon-1.0.0

Base Directory: C:\usr\opt\Griffon\griffon-1.0.0\samples\FontPicker
Running script C:\usr\opt\Griffon\griffon-1.0.0\scripts\RunApp.groovy
Resolving dependencies...
Dependencies resolved in 616ms.
Environment set to development
Resolving framework plugin dependencies ...
Framework plugin dependencies resolved in 835 ms.
Resolving plugin dependencies ...
Some dependencies have conflicts.
-= INSTALLED =-

-= MISSING =-
! miglayout-0.4 from griffon-local
   ! swing-0.9.5 from griffon-local
! swing-1.0.0 from griffon-local
Could not resolve plugin dependencies.
  • 原因

プラグインがあっていない

  • 対処

プラグインをインストール
Enables Swing support

    griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/swing/1.0.0/griffon-swing-1.0.0.zip
SwingPadの実行
[C:\usr\opt\Griffon\griffon-1.0.0\samples\SwingPad]griffon run-app
Welcome to Griffon 1.0.0 - http://griffon-framework.org/
Licensed under Apache Standard License 2.0
Griffon home is set to: C:\usr\opt\Griffon\griffon-1.0.0

Base Directory: C:\usr\opt\Griffon\griffon-1.0.0\samples\SwingPad
Running script C:\usr\opt\Griffon\griffon-1.0.0\scripts\RunApp.groovy
Resolving dependencies...
Dependencies resolved in 675ms.
Environment set to development
Resolving framework plugin dependencies ...
Framework plugin dependencies resolved in 579 ms.
Resolving plugin dependencies ...
Some dependencies have conflicts.
-= INSTALLED =-

-= MISSING =-
! zonelayout-0.3 from griffon-central
   ! swing-0.9.5 from griffon-local
+ gfx-builder-0.7 from griffon-central
! dialogs-0.3 from griffon-central
   ! glazedlists-0.9 from griffon-local
      ! swing-0.9.5 from griffon-local
   ! miglayout-0.4 from griffon-local
      ! swing-0.9.5 from griffon-local
   ! actions-0.4 from griffon-local
      + i18n-support-0.2 from griffon-local
      ! swing-0.9.5 from griffon-local
! jxlayer-0.3 from griffon-central
   ! swing-0.9.5 from griffon-local
! riverlayout-0.3 from griffon-central
   ! swing-0.9.5 from griffon-local
! jexplose-0.3 from griffon-central
   ! swing-0.9.5 from griffon-local
+ swingx-builder-0.6 from griffon-central
! coverflow-0.6 from griffon-central
   ! swing-0.9.5 from griffon-local
! swing-1.0.0 from griffon-local
+ trident-builder-0.8 from griffon-central
! jgoodies-forms-0.5 from griffon-central
   ! swing-0.9.5 from griffon-local
! syntaxtext-0.2 from griffon-central
   ! swing-0.9.5 from griffon-local
! transitions-0.6 from griffon-central
   + trident-builder-0.8 from griffon-central
   ! swing-0.9.5 from griffon-local
! tray-builder-0.8 from griffon-central
   ! swing-0.9.5 from griffon-local
! designgridlayout-0.5 from griffon-central
   ! swing-0.9.5 from griffon-local
+ css-builder-0.9 from griffon-central
! silkicons-0.3 from griffon-central
   ! swing-0.9.5 from griffon-local
+ macwidgets-builder-0.6 from griffon-local
! crystalicons-0.3 from griffon-central
   ! swing-0.9.5 from griffon-local
+ installer-0.6 from griffon-central
+ jide-builder-0.7 from griffon-central
! jbusycomponent-0.6 from griffon-central
   ! jxlayer-0.3 from griffon-central
      ! swing-0.9.5 from griffon-local
   + swingx-builder-0.6 from griffon-central
Could not resolve plugin dependencies.
  • 原因

プラグインがあってない

  • 対処
griffon install-plugin zonelayout

GroovyFxPadで書いたプラグインをインストールしてなければ
それもインストール。


GroovyEditの実行
[C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit]griffon run-app
Welcome to Griffon 1.0.0 - http://griffon-framework.org/
Licensed under Apache Standard License 2.0
Griffon home is set to: C:\usr\opt\Griffon\griffon-1.0.0

Base Directory: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit
Running script C:\usr\opt\Griffon\griffon-1.0.0\scripts\RunApp.groovy
Resolving dependencies...
Dependencies resolved in 721ms.
Environment set to development
Resolving framework plugin dependencies ...
Framework plugin dependencies resolved in 790 ms.
Resolving plugin dependencies ...
Software license of swing-1.0.0 is 'Apache Software License 2.0' ...
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\plugins\swing-1.0.0
    [unzip] Expanding: C:\Users\orangeclover\.griffon\repository\plugins\swing\1.0.0\griffon-swing-1.0.0.zip into C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\plugins\swing-1.0.0
Resolving plugin swing-1.0.0 JAR dependencies ...
Executing swing-1.0.0 plugin post-install script ...
     [copy] Copying 1 resource to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\swing-install-tmp
    [unjar] Expanding: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\swing-install-tmp\griffon-app-files.jar into C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\swing-install-tmp
   [delete] Deleting: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\swing-install-tmp\griffon-app-files.jar
   [delete] Deleting directory C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\swing-install-tmp
Installed plugin 'swing-1.0.0' in C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\plugins/swing-1.0.0
Plugin dependencies resolved in 4550 ms.
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\classes\cli
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\classes\main
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\classes\test
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\test-classes
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\test-resources
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources
 [griffonc] Compiling 13 source files to C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\classes\main
 [griffonc] Compiling 3 source files to C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\classes\main
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\conf\dist
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\conf\dist\applet
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\conf\dist\jar
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\conf\dist\shared
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\conf\dist\webstart
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\conf\dist\zip
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\conf\metainf
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\lib
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\scripts
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\test\unit
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources\griffon-app\i18n
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources\griffon-app\resources
     [copy] Copying 1 file to C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources\griffon-app\i18n
     [copy] Copying 8 files to C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources\griffon-app\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources\griffon-app\resources
     [copy] Copying 1 file to C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\classes\main
     [copy] Copying 13 files to C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources
     [copy] Copied 9 empty directories to 8 empty directories under C:\Users\orangeclover\.griffon\1.0.0\projects\GroovyEdit\resources
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\staging
Launching application ...
2012-06-09 19:03:49,460 [main] ERROR griffon.util.GriffonExceptionHandler - Uncaught Exception
java.lang.NullPointerException: Cannot get property 'document' on null object
        at groovyedit.GroovyEditModel$_closure1.doCall(GroovyEditModel.groovy:22)
        at $Proxy5.propertyChange(Unknown Source)
        at org.codehaus.griffon.runtime.core.AbstractGriffonModel.firePropertyChange(AbstractGriffonModel.java:72)
        at groovyedit.GroovyEditModel.setMvcId(GroovyEditModel.groovy)
        at org.codehaus.griffon.runtime.core.DefaultMVCGroupManager.fillReferencedProperties(DefaultMVCGroupManager.java:253)
        at org.codehaus.griffon.runtime.core.DefaultMVCGroupManager.buildMVCGroup(DefaultMVCGroupManager.java:143)
        at org.codehaus.griffon.runtime.core.AbstractMVCGroupManager.createMVCGroup(AbstractMVCGroupManager.java:238)
        at org.codehaus.griffon.runtime.core.AbstractMVCGroupManager.createMVCGroup(AbstractMVCGroupManager.java:186)
        at org.codehaus.griffon.runtime.core.AbstractGriffonApplication.createMVCGroup(AbstractGriffonApplication.java:474)
        at org.codehaus.griffon.runtime.core.AbstractGriffonApplication.startup(AbstractGriffonApplication.java:313)
        at griffon.swing.AbstractSwingGriffonApplication.realize(AbstractSwingGriffonApplication.java:78)
        at griffon.swing.AbstractSwingGriffonApplication.run(AbstractSwingGriffonApplication.java:132)
        at griffon.swing.SwingApplication.main(SwingApplication.java:36)
        

わからん。

コードが多分おかしいので、ここら辺は多分kiy0takaさんレベルじゃないと
パッと直せないんだろうなと(これプラグイン使っていないので

といいつつサクッと直してしまう、@kimukou2628

  • 原因

app.models[e.newValue].document が null になっている。

  • 対処
    • ?. (nullセーフナビゲーション プログラミングGROOVY p92)でNullPointerExeceptionが発生しないようにして取得
    • null だったら、documento生成


C:\usr\opt\Griffon\griffon-1.0.0\samples\GroovyEdit\griffon-app\models\groovyedit\GroovyEditModel.groovy

--- 修正前
+++ 修正後
@@ -19,7 +19,8 @@
     private mvcUpdater = { e ->
         Document document = null
         if(e.newValue) {
-            document = app.models[e.newValue].document 
+            document = app.models[e.newValue]?.document
+            if(document==null)document = new Document()
         } else {
             document = new Document()
         }

未解決

Greetの実行


ログインボタンをクリックでエラー

[C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet]griffon run-app
Welcome to Griffon 1.0.0 - http://griffon-framework.org/
Licensed under Apache Standard License 2.0
Griffon home is set to: C:\usr\opt\Griffon\griffon-1.0.0

Base Directory: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet
Running script C:\usr\opt\Griffon\griffon-1.0.0\scripts\RunApp.groovy
Resolving dependencies...
Dependencies resolved in 513ms.
Environment set to development
Resolving framework plugin dependencies ...
Framework plugin dependencies resolved in 603 ms.
Resolving plugin dependencies ...
Software license of swing-1.0.0 is 'Apache Software License 2.0' ...
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\plugins\swing-1.0.0
    [unzip] Expanding: C:\Users\orangeclover\.griffon\repository\plugins\swing\1.0.0\griffon-swing-1.0.0.zip into C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\plugins\swing-1.0.0
Resolving plugin swing-1.0.0 JAR dependencies ...
Executing swing-1.0.0 plugin post-install script ...
     [copy] Copying 1 resource to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\swing-install-tmp
    [unjar] Expanding: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\swing-install-tmp\griffon-app-files.jar into C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\swing-install-tmp
   [delete] Deleting: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\swing-install-tmp\griffon-app-files.jar
   [delete] Deleting directory C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\swing-install-tmp
Installed plugin 'swing-1.0.0' in C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\plugins/swing-1.0.0
Plugin dependencies resolved in 4509 ms.
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\classes\cli
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\classes\main
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\classes\test
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\test-classes
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\test-resources
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources
 [griffonc] Compiling 27 source files to C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\classes\main
 [griffonc] Threading injection feature disabled.
 [griffonc] 注意:C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\src\main\greet\DelayedImageIcon.javaの操作は、未チェックまたは安全ではありません。
 [griffonc] 注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
 [griffonc] Compiling 3 source files to C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\classes\main
 [griffonc] Threading injection feature disabled.
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\keys
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\dist
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\dist\applet
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\dist\jar
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\dist\shared
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\dist\webstart
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\dist\zip
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\griffon-app\conf\metainf
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\lib
    [mkdir] Created dir: C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\scripts
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources\griffon-app\i18n
    [mkdir] Created dir: C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources\griffon-app\resources
     [copy] Copying 1 file to C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources\griffon-app\i18n
     [copy] Copying 13 files to C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources\griffon-app\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources\griffon-app\resources
     [copy] Copying 1 file to C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\classes\main
     [copy] Copying 13 files to C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources
     [copy] Copied 9 empty directories to 9 empty directories under C:\Users\orangeclover\.griffon\1.0.0\projects\Greet\resources
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
     [copy] Copying 1 file to C:\usr\opt\Griffon\griffon-1.0.0\samples\Greet\staging
Launching application ...
2012-06-09 19:04:54,865 [main] DEBUG griffon.app.view.greet.GreetView - Upgrading MetaClass to groovy.lang.ExpandoMetaClass@292bdb00[class greet.GreetView]
2012-06-09 19:04:55,164 [main] DEBUG griffon.app.view.greet.LoginPaneView - Upgrading MetaClass to groovy.lang.ExpandoMetaClass@19707bb9[class greet.LoginPaneView]

java.io.IOException: Server returned HTTP response code: 401 for URL: http://twitter.com/account/verify_credentials.xml
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1615)
        at java.net.URL.openStream(URL.java:1035)
        at java_net_URL$openStream.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at greet.MicroblogService.slurpAPIStream(MicroblogService.groovy:105)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:992)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
        at greet.MicroblogService$_login_closure4.doCall(MicroblogService.groovy:122)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:226)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
        at greet.MicroblogService$_login_closure4.doCall(MicroblogService.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
        at groovy.lang.Closure.call(Closure.java:412)
        at groovy.lang.Closure.call(Closure.java:406)
        at java_util_concurrent_Callable$call.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at greet.MicroblogService.withStatus(MicroblogService.groovy:82)
        at greet.MicroblogService$withStatus.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
        at greet.MicroblogService.login(MicroblogService.groovy:116)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:226)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at greet.LoginPaneController$_login_closure2.doCall(LoginPaneController.groovy:40)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:921)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
        at groovy.lang.Closure.call(Closure.java:412)
        at groovy.lang.Closure.call(Closure.java:406)
        at groovy.lang.Closure.run(Closure.java:490)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        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)

ログインは未実装なの?

これAtom時代のTwログインのままなんですね(今はTwitterはOAuth形式)。













Andres Almiray、Danno Ferrin

価格: ¥ 3,746


価格は記載時点のものです。購入前にAmazonでご確認ください。







今日からGroovyを始めるための4つのステップ






関谷 和愛、上原 潤二、須江 信洋、中野 靖治
価格: ¥ 3,360
価格は記載時点のものです。購入前にAmazonでご確認ください。





「プログラミングGROOVY」正誤表



操作間違えてタイトル消して更新してしまった。
@kimukou2628 のコメントもそのきに消えてしまったようなので
本文に記載。

SwingPad)
GroovyFxPadを入れ済みなら

griffon install-plugin zonelayout
の最初でつまずいているだけなのでそれでいけますよ

GroovyEdit)
コードが多分おかしいので、ここら辺は多分kiy0takaさんレベルじゃないと
パッと直せないんだろうなと(これプラグイン使っていないので

Greet)
これAtom時代のTwログインのままなんですね(今はTwitterはOAuth形式)。
でもTweegleやkiy0takaさんのGマガ連載で使っている
Twitter(4J)Pluginもあるんですが
griffonの仕様がコロコロ変わっているのでイベント割込の処とかがまだ未メンテで動かせないです

githubでsample自体も公開されていれば直す人はいそうですが。..