Grails
  1. Grails
  2. GRAILS-8573

Grails 2.0.0 - code reload does not work in Windows 7 running grails run-app in command line

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0 final, 2.1.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7 Professional 64-bit
      intel i3-2310M CPU @ 2.10GHz
      4.00GB RAM
      Java JDK 1.6.0_26 64-bit

      Description

      This is an issue in Grails 2.0.0 running on Windows 7 64-bit.

      Whenever I make any change in a controller class, the code reload does not work (the change does not take effect) even though in the console, it says "Compiling 2 source files." I need to restart my local grails instance to let the new change take effect.

      I tested this on my other laptop running on Mac OS X Lion, and it does NOT have the same issue. So it must be something related to Windows-specific.

      I have included a sample project that has a bare-bones Model class and controller with its scaffolded views. I added one line of code (log.info statement) in the list method of BookController.groovy.

      To reproduce:
      1) on Windows 7, unzip the reload-fail.zip
      2) run grails-app in command line
      3) once server is up, go to http://localhost:8080/reload-fail/book/list in browser
      4) in the local server console log, you will see a log message with "INFO fail.BookController - in list method."
      5) change line 14 in grails-app/controllers/reload/fail/BookController.groovy to be: log.info("in list method.2")
      6) save the change in the controller.
      7) reload http://localhost:8080/reload-fail/book/list in browser
      8) local server console log still displays "INFO fail.BookController - in list method." and not "INFO fail.BookController - in list method.2"

        Issue Links

          Activity

          Hide
          Scott Eisenberg added a comment -

          I'm having the same problem on a Mac running 10.8.2 (Mountain Lion, I think). Domain (changes) and controllers (new one) definitely not reloading. Exiting server does not fix. Need to exit from command line and restart the agent completely to get the changes to appear.

          Running 2.1.1 grails, app created new. Will try to show to Grails guys at SpringSource if I can find them.

          Show
          Scott Eisenberg added a comment - I'm having the same problem on a Mac running 10.8.2 (Mountain Lion, I think). Domain (changes) and controllers (new one) definitely not reloading. Exiting server does not fix. Need to exit from command line and restart the agent completely to get the changes to appear. Running 2.1.1 grails, app created new. Will try to show to Grails guys at SpringSource if I can find them.
          Hide
          Aleksandr added a comment -

          Same issue on Mac OS 10.8.2, grails version = 2.0.4, java version "1.6.0_37"
          I have to reload the server to get changes.

          Show
          Aleksandr added a comment - Same issue on Mac OS 10.8.2, grails version = 2.0.4, java version "1.6.0_37" I have to reload the server to get changes.
          Hide
          miles added a comment -

          Same issue on Mint Linux. I don't think the OS probably matters, from what I've seen above.

          The commands I'm using:

          $ grails
          <starts grails>
          grails> dev run-app

          JDK 1.6.0_30
          grails 2.1.0

          It worked OK for a while, but now it has stopped seeing my changes. I have no idea what I might have changed, if anything, that caused it to stop working. If I can isolate a particular factor, I will be sure to post it here.

          Show
          miles added a comment - Same issue on Mint Linux. I don't think the OS probably matters, from what I've seen above. The commands I'm using: $ grails <starts grails> grails> dev run-app JDK 1.6.0_30 grails 2.1.0 It worked OK for a while, but now it has stopped seeing my changes. I have no idea what I might have changed, if anything, that caused it to stop working. If I can isolate a particular factor, I will be sure to post it here.
          Hide
          miles added a comment - - edited

          I figured out the difference between when it works and when it doesn't work, on my system:

          FAIL:
          If I start up grails FIRST, then say 'dev run-app' it doesn't work. It doesn't notice when files have changed, to recompile them.

          SUCCESS:
          If I run it by saying (all on one command line from the shell):
          grails dev run-app

          the automatic recompile starts working again.

          Hope this helps.

          Show
          miles added a comment - - edited I figured out the difference between when it works and when it doesn't work, on my system: FAIL: If I start up grails FIRST, then say 'dev run-app' it doesn't work. It doesn't notice when files have changed, to recompile them. SUCCESS: If I run it by saying (all on one command line from the shell): grails dev run-app the automatic recompile starts working again. Hope this helps.
          Hide
          Meher added a comment -

          @miles you saved my life man ! thank you.

          (I was running grails in debug mode with IntelliJ Idea .. )

          By the way I just had the same issue after upgrading from grails 2.1.0 to 2.2.0 well I upgraded the resources too to 1.2.RC but I don't think that's the problem.
          I'm on Windows 7 / JDK 1.7.0_70 / Grails 2.2.0

          Show
          Meher added a comment - @miles you saved my life man ! thank you. (I was running grails in debug mode with IntelliJ Idea .. ) By the way I just had the same issue after upgrading from grails 2.1.0 to 2.2.0 well I upgraded the resources too to 1.2.RC but I don't think that's the problem. I'm on Windows 7 / JDK 1.7.0_70 / Grails 2.2.0

            People

            • Assignee:
              Unassigned
              Reporter:
              Myong Chong
            • Votes:
              18 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

              • Created:
                Updated:
                Last Reviewed:

                Development