Grails
  1. Grails
  2. GRAILS-8951

Auto reloading does not work when running grails console with -D param

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1, 2.1.1
    • Fix Version/s: 2.1.6, 2.3.9
    • Component/s: Configuration
    • Labels:
      None
    • Environment:
      Grails 2.0.1
      Java version "1.6.0_29"
      Mac OS X 10.6.8

      Description

      When running the grails console with any system property parameter (-D), the auto reloading feature does not work anymore. To replicate the problem, follow these steps:

      1. Run grails console with the -D param. You can use any system property, for example:

      grails -Dfoo=foo

      2. Run the application using run-app command

      grails> run-app

      3. Change any codes in the application.

      4. Grails console does not show any log message telling that the code change has been compiled. The changes do not get applied also in the running application.

      Only after removing the -D param when running Grails console, the auto reloading feature works again.

      I have tested this behavior only with Grails 2.0.1.

        Issue Links

          Activity

          Hide
          Johannes Link added a comment -

          @Rick Just found a workaround for IntelliJ. See http://youtrack.jetbrains.com/issue/IDEA-98131
          Just add "-javaagent:$

          {GRAILS_HOME}

          /lib/org.springsource.springloaded/springloaded-core/jars/springloaded-core-1.1.1.jar -Xverify:none" to the configurations VM options. Worked for me.

          Show
          Johannes Link added a comment - @Rick Just found a workaround for IntelliJ. See http://youtrack.jetbrains.com/issue/IDEA-98131 Just add "-javaagent:$ {GRAILS_HOME} /lib/org.springsource.springloaded/springloaded-core/jars/springloaded-core-1.1.1.jar -Xverify:none" to the configurations VM options. Worked for me.
          Hide
          cdeszaq added a comment -

          @Johannes, You, sir, are my hero. That workaround worked wonderfully.

          Show
          cdeszaq added a comment - @Johannes, You, sir, are my hero. That workaround worked wonderfully.
          Hide
          Joe Mesterhazy added a comment -

          @Johannes suggestion worked for me also. Added that string to the project run configuration (with the actual path to grails in place of GRAILS_HOME) and auto-compiling works again. Idea 12/MacOS/JVM 1.6/GRAILS 2.2.0.

          Show
          Joe Mesterhazy added a comment - @Johannes suggestion worked for me also. Added that string to the project run configuration (with the actual path to grails in place of GRAILS_HOME) and auto-compiling works again. Idea 12/MacOS/JVM 1.6/GRAILS 2.2.0.
          Hide
          Jeff Scott Brown added a comment -

          I just tested with 2.2.3 and it looks like specifying -reloading as the first argument does make the problem go away (at least on OS X that is what I am seeing). If I start the interactive console like this, reloading does not work:

          grails -Dfoo=foo
          

          If I start the interactive console like this, reloading does not work:

          grails -Dfoo=foo -reloading
          

          If I start the interactive console like this, reloading does work:

          grails -reloading -Dfoo=foo
          
          Show
          Jeff Scott Brown added a comment - I just tested with 2.2.3 and it looks like specifying -reloading as the first argument does make the problem go away (at least on OS X that is what I am seeing). If I start the interactive console like this, reloading does not work: grails -Dfoo=foo If I start the interactive console like this, reloading does not work: grails -Dfoo=foo -reloading If I start the interactive console like this, reloading does work: grails -reloading -Dfoo=foo
          Hide
          Dominic Clifton added a comment -

          Looks like this might be related to GRAILS-10267 "The '-noreloading' argument is ignored when it is not the first command line argument"

          Show
          Dominic Clifton added a comment - Looks like this might be related to GRAILS-10267 "The '-noreloading' argument is ignored when it is not the first command line argument"

            People

            • Assignee:
              Unassigned
              Reporter:
              Jojo Pad
            • Votes:
              12 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:
                Last Reviewed:

                Development