Grails
  1. Grails
  2. GRAILS-4686

Grails constantly auto-reloads if a groovy source file is put in /src

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.1.1
    • Component/s: ContinuousBuild
    • Labels:
      None
    • Environment:
      Ubuntu Linux 9.04
      maven-grails-plugin
      Grails 1.1.1 Groovy 1.6.3

      Description

      Haven't tried this without the maven plugin due to classpath issues which are handled by maven, it could be the maven-grails-plugin which is causing this.

      When I place a class in /src/groovy/gamesys.xxxx.xxxx.util called CsvParser.groovy

      I run my application with:

      mvn grails:run-app

      and the auto-reloading will kick in about once every 2 seconds, meaning it is impossible to test my application in the browser.

      The console log is;

      Running Grails application..
      spring.BeanBuilder Creating messageSource with basenames: [WEB-INF/grails-app/i18n/messages]
      spring.BeanBuilder [RuntimeConfiguration] Configuring data source for environment: development
      spring.BeanBuilder Configuring controller MemberSegmentController
      spring.BeanBuilder Configuring controller xxxxxxController
      Server running. Browse to http://localhost:8080/xxxxxx-xxxxxx
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      Running Grails application..
      spring.BeanBuilder Creating messageSource with basenames: [WEB-INF/grails-app/i18n/messages]
      spring.BeanBuilder [RuntimeConfiguration] Configuring data source for environment: development
      spring.BeanBuilder Configuring controller MemberSegmentController
      spring.BeanBuilder Configuring controller xxxxxxController
      Server running. Browse to http://localhost:8080/xxxxxx-xxxxxx
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      Running Grails application..
      spring.BeanBuilder Creating messageSource with basenames: [WEB-INF/grails-app/i18n/messages]
      spring.BeanBuilder [RuntimeConfiguration] Configuring data source for environment: development
      spring.BeanBuilder Configuring controller xxxxxxController
      spring.BeanBuilder Configuring controller MemberSegmentController
      Server running. Browse to http://localhost:8080/xxxxxx-xxxxxx
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      Running Grails application..
      spring.BeanBuilder Creating messageSource with basenames: [WEB-INF/grails-app/i18n/messages]
      spring.BeanBuilder [RuntimeConfiguration] Configuring data source for environment: development
      spring.BeanBuilder Configuring controller xxxxxxController
      spring.BeanBuilder Configuring controller MemberSegmentController
      Server running. Browse to http://localhost:8080/xxxxxx-xxxxxx
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      Running Grails application..
      spring.BeanBuilder Creating messageSource with basenames: [WEB-INF/grails-app/i18n/messages]
      spring.BeanBuilder [RuntimeConfiguration] Configuring data source for environment: development
      spring.BeanBuilder Configuring controller MemberSegmentController
      spring.BeanBuilder Configuring controller xxxxxxController
      Server running. Browse to http://localhost:8080/xxxxxx-xxxxxx
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      Running Grails application..
      spring.BeanBuilder Creating messageSource with basenames: [WEB-INF/grails-app/i18n/messages]
      spring.BeanBuilder [RuntimeConfiguration] Configuring data source for environment: development
      spring.BeanBuilder Configuring controller MemberSegmentController
      spring.BeanBuilder Configuring controller xxxxxxController
      Server running. Browse to http://localhost:8080/xxxxxx-xxxxxx
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      [groovyc] Compiling 1 source file to /home/antonyj/workspaces/idea-new/xxxxxx-xxxxxx/target/classes
      Running Grails application..
      spring.BeanBuilder Creating messageSource with basenames: [WEB-INF/grails-app/i18n/messages]
      spring.BeanBuilder [RuntimeConfiguration] Configuring data source for environment: development
      spring.BeanBuilder Configuring controller xxxxxxController
      spring.BeanBuilder Configuring controller MemberSegmentController
      Server running. Browse to http://localhost:8080/xxxxxx-xxxxxx

        Activity

        Hide
        Graeme Rocher added a comment -

        This happens if you package/class name in the groovy source doesn't match the file name. Fix this and it will stop reloading

        Show
        Graeme Rocher added a comment - This happens if you package/class name in the groovy source doesn't match the file name. Fix this and it will stop reloading
        Hide
        Antony Jones added a comment -

        Hi Graeme,

        Just checked the package/filename, the structure is:

        src/
        groovy/
        gamesys/
        foo/
        bar/
        util/
        CsvParser.groovy

        and the top of the file is:

        package gamesys.foo.bar.util

        Seems like it should be ok?

        Show
        Antony Jones added a comment - Hi Graeme, Just checked the package/filename, the structure is: src/ groovy/ gamesys/ foo/ bar/ util/ CsvParser.groovy and the top of the file is: package gamesys.foo.bar.util Seems like it should be ok?
        Hide
        Antony Jones added a comment -

        Just after writing this, I noted I had:

        CSVParser.groovy
        class CsvParser.

        Oops! I'm going to have to get used to intellij not showing me these things.

        I'll close the bug. Thanks.

        Show
        Antony Jones added a comment - Just after writing this, I noted I had: CSVParser.groovy class CsvParser. Oops! I'm going to have to get used to intellij not showing me these things. I'll close the bug. Thanks.
        Hide
        Antony Jones added a comment -

        File name and class name did not match. Perhaps a log warning message rather than the auto-reload cycle is needed though?

        Show
        Antony Jones added a comment - File name and class name did not match. Perhaps a log warning message rather than the auto-reload cycle is needed though?
        Hide
        Rainer Brang added a comment -

        Yes, some warning would help. Thank god I found this discussion.

        Show
        Rainer Brang added a comment - Yes, some warning would help. Thank god I found this discussion.
        Hide
        Michael Dickey added a comment -

        +1 needs warning or something

        Show
        Michael Dickey added a comment - +1 needs warning or something
        Hide
        Konstantin added a comment -

        Hi All,
        This information has surprised me very much.
        How can I get report about these incorrect path or name Groovy/Grails problems in SpringSource Tool Suite IDE (or Eclipse IDE, or somewhere)?
        I have expected for report looks like JavaProblems list in Eclipse Integrated Development Environment..
        Dear Graeme,
        What does mean Resolution: Fixed for this bug?!
        Are you interesting in usability of Groovy/Grails?
        If yes, you should give users easy way to find such errors. For example I have about 83 groovy files in about 10 directories. Am I should manually check all these files for path, name, etc. problems? Or exists some easier and faster way?
        Thank you for any possible help,
        Konstantin.

        Show
        Konstantin added a comment - Hi All, This information has surprised me very much. How can I get report about these incorrect path or name Groovy/Grails problems in SpringSource Tool Suite IDE (or Eclipse IDE, or somewhere)? I have expected for report looks like JavaProblems list in Eclipse Integrated Development Environment.. Dear Graeme, What does mean Resolution: Fixed for this bug?! Are you interesting in usability of Groovy/Grails? If yes, you should give users easy way to find such errors. For example I have about 83 groovy files in about 10 directories. Am I should manually check all these files for path, name, etc. problems? Or exists some easier and faster way? Thank you for any possible help, Konstantin.
        Hide
        Graeme Rocher added a comment -

        @Konstantin - Try to remain calm, no need to get upset about this, deep breaths

        It is marked as fixed, because the problem no longer exists in Grails 2.0. If you are using Grails 1.3.7 you can use grails compile -verboseCompile to get information about what file is causing the problem

        Show
        Graeme Rocher added a comment - @Konstantin - Try to remain calm, no need to get upset about this, deep breaths It is marked as fixed, because the problem no longer exists in Grails 2.0. If you are using Grails 1.3.7 you can use grails compile -verboseCompile to get information about what file is causing the problem

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Antony Jones
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development