0

I just searching in google recently and want to try this code below to work in Griffon 1.2.0 but when i run it it give me error like this:

2013-03-23 12:13:01,877 [main] DEBUG griffon.plugins.i18n.I18nEnhancer - Enhancing org.codehaus.groovy.runtime.HandleMetaClass@b7ea5c[groovy.lang.ExpandoMetaClass@b7ea5c[class griffon.swing.SwingApplication]] with griffon.plugins.i18n.MessageSourceHolder@7b7bee
2013-03-23 12:13:01,909 [main] ERROR griffon.util.GriffonExceptionHandler - Uncaught Exception
groovy.lang.GroovyRuntimeException: Cannot add new method [getMessage] for arguments [[class java.lang.String, class java.util.Locale]]. It already exists!
    at griffon.plugins.i18n.I18nEnhancer.enhance(I18nEnhancer.groovy:34)
    at griffon.plugins.i18n.I18nEnhancer.enhance(I18nEnhancer.groovy)
    at griffon.plugins.i18n.I18nEnhancer$enhance.call(Unknown Source)
    at I18nSupportGriffonAddon.addonPostInit(I18nSupportGriffonAddon.groovy:40)
    at griffon.core.GriffonAddon$addonPostInit.call(Unknown Source)
    at griffon.core.GriffonAddon$addonPostInit.call(Unknown Source)
    at org.codehaus.griffon.runtime.util.AddonHelper$_handleAddonsAtStartup_closure3.doCall(AddonHelper.groovy:110)
    at org.codehaus.griffon.runtime.util.AddonHelper.handleAddonsAtStartup(AddonHelper.groovy:108)
    at org.codehaus.griffon.runtime.core.DefaultAddonManager.doInitialize(DefaultAddonManager.java:33)
    at org.codehaus.griffon.runtime.core.AbstractAddonManager.initialize(AbstractAddonManager.java:101)
    at org.codehaus.griffon.runtime.util.GriffonApplicationHelper.initializeAddonManager(GriffonApplicationHelper.java:394)
    at org.codehaus.griffon.runtime.util.GriffonApplicationHelper.prepare(GriffonApplicationHelper.java:149)
    at org.codehaus.griffon.runtime.core.AbstractGriffonApplication.initialize(AbstractGriffonApplication.java:231)
    at griffon.swing.AbstractSwingGriffonApplication.bootstrap(AbstractSwingGriffonApplication.java:75)
    at griffon.swing.AbstractSwingGriffonApplication.run(AbstractSwingGriffonApplication.java:132)
    at griffon.swing.SwingApplication.run(SwingApplication.java:45)
    at griffon.swing.SwingApplication.main(SwingApplication.java:37)
   [delete] Deleting directory G:\latihan\outer\staging\windows

Here's the code, this was originaly made by aalmiray

--- OuterController ---
package outer

class OuterController {
    def model
    def view
    def builder

    def newFrame = {
        String id = 'inner-' + System.currentTimeMillis()
        def (m, v, c) = createMVCGroup('inner', id, title: "Frame ${model.count++}")
        builder.desktopPane(view.desktop) {
            widget(v.innerFrame)
        }
    }
}

--- OuterModel ---
package outer

class OuterModel {
    int count = 1
}

--- OuterView ---
package outer

application(title: 'outer',
  preferredSize: [320, 240],
  pack: true,
  locationByPlatform:true,
  iconImage: imageIcon('/griffon-icon-48x48.png').image,
  iconImages: [imageIcon('/griffon-icon-48x48.png').image,
               imageIcon('/griffon-icon-32x32.png').image,
               imageIcon('/griffon-icon-16x16.png').image]) {
    borderLayout()
    button(newFrameAction, constraints: NORTH)
    desktopPane(id: 'desktop', constraints: CENTER)
}

--- InnerController ---
package outer

class InnerController {
    private String id
    def view

    void mvcGroupInit(Map args) {
        id = args.mvcName
    }

    void mvcGroupDestroy() {      
        execAsync {
            def desktop = view.innerFrame.parent
            desktop.remove view.innerFrame
            desktop.invalidate()
            desktop.repaint()
        }
    }

    def close = {
        destroyMVCGroup id
    }
}

--- InnerView ---
package outer

internalFrame(title: title, size: [200, 200], id: 'innerFrame',
    visible: true, iconifiable: true, maximizable: true,
    resizable: true, closable: true) {
    gridLayout(cols: 1, rows: 2)
    label 'Content goes here'
    button closeAction    
}

I need your help.

Regards, Hendra

tereško
  • 58,060
  • 25
  • 98
  • 150
hendrakmg
  • 37
  • 7

1 Answers1

1

Gievn the error message I'd say you have the i18n and i18n-support plugins installed. These plugins are no longer required since Griffon 1.1.0. Uninstalling the plugins will solve your problem.

The reason is that the functionality provided by those plugins is now available in Griffon core since 1.1.0, so those plugins create a conflict.

Andres Almiray
  • 3,236
  • 18
  • 28
  • Thanks for your respond. I tried to uninstall i18n-support plugin but still when i run the program it's install itself again, i delete the plugin in the griffon project and local-repository, but still it download again. The last i turn off the internet and uninstall it again and deleting it, when i run it again it's said missing plugin for actions plugin. How do i fix it? – hendrakmg Mar 23 '13 at 14:24
  • You must have both i18n and i18n-support uninstalled. If invoking uninstall-plugin is not working for you then you can manually force the plugin composition: simple edit application.properties and remove both entries from this file. – Andres Almiray Mar 23 '13 at 18:14