Griffon
  1. Griffon
  2. GRIFFON-384

slurper.parse(SomeConfGroovyClass) fails after clean

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.3-beta-2
    • Fix Version/s: 0.9.4
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP
    • Number of attachments :
      0

      Description

      Slurping an external configuration class (also located at griffon-app/conf) in config.groovy with: slurper.parse(ExConf) after running griffon clean causes:

      Error executing script RunApp: No signature of method: groovy.util.ConfigSlurper.parse() is applicable for argument types: (groovy.util.ConfigObject) values: [[:]]

      The application runs again only after I quote the class name (i.e. slurper.parse('ExConf').

      This of course gives me a useless empty map as result, but if I close the application, unquote the class name and run it again, it works as expected.

      In essence, after a griffon clean I must: quote slurped class name > run-app > close app > unquote slurped class name > run-app

        Activity

        Hide
        Andres Almiray added a comment -

        What component makes use of the slurper? Is it a controller or an event handler?

        Show
        Andres Almiray added a comment - What component makes use of the slurper? Is it a controller or an event handler?
        Hide
        Edo added a comment - - edited

        The slurper is used in Config.groovy.

        The slurper is built for the dev environment in Config.groovy too.

        Show
        Edo added a comment - - edited The slurper is used in Config.groovy. The slurper is built for the dev environment in Config.groovy too.
        Hide
        Andres Almiray added a comment -

        The problem appears to be an eager compilation of Config.groovy. When that happens no additional config files available at griffon-app/conf are compiled, that's why it fails after a clean operation.

        May I ask, why do you need to parse the additional config file inside Config.groovy? The data in that file can be parsed using either the Initialize.groovy lifecycle script of by registering an application event handler (listening to onBootstrapStart event)

        Show
        Andres Almiray added a comment - The problem appears to be an eager compilation of Config.groovy. When that happens no additional config files available at griffon-app/conf are compiled, that's why it fails after a clean operation. May I ask, why do you need to parse the additional config file inside Config.groovy? The data in that file can be parsed using either the Initialize.groovy lifecycle script of by registering an application event handler (listening to onBootstrapStart event)
        Hide
        Edo added a comment -

        I was mostly parsing it in config.groovy as an alternative to grail's grails.config.locations configuration merging. I am currently working around the issue by simply placing the config objects directly in config.groovy, I'll move it to Initialize.groovy as you suggested.

        Thank you for your input.

        Show
        Edo added a comment - I was mostly parsing it in config.groovy as an alternative to grail's grails.config.locations configuration merging. I am currently working around the issue by simply placing the config objects directly in config.groovy, I'll move it to Initialize.groovy as you suggested. Thank you for your input.

          People

          • Assignee:
            Andres Almiray
            Reporter:
            Edo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: