Uploaded image for project: 'Grails'
  1. Grails
  2. GRAILS-8271

grails will not start with MingW32 and the reloading agent

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-RC1
    • Fix Version/s: None
    • Component/s: Commons
    • Labels:
      None
    • Environment:
      Windows 7 64 bit with Mingw32 shell
    • Patch Submitted:
      Yes

      Description

      The -javaagent path is not recognized by Mingw32, so when the path is passed as a Unix path java fails to read the agent JAR

        Issue Links

          Activity

          Hide
          Rob Elsner added a comment -
          Show
          Rob Elsner added a comment - Submitted pull request, my fork is here: https://github.com/thatsnotright/grails-core/commit/abb865d5b5041ae034053aa7c1cb80b528335668
          Hide
          Guillaume Balaine added a comment - - edited

          Actually you made a mistake when adding your fix. Sorry about that.
          The lines you added don't make sense at all :

          AGENT_LIBRARY="lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.1.jar"
          AGENT_STRING="-javaagent:$AGENT_GRAILS_HOME/$AGENT_LIBRARY -noverify -Dspringloaded=profile=grails"
          if $mingw ; then
          AGENT_GRAILS_JAR=`cmd //C echo $AGENT_GRAILS_HOME/$AGENT_LIBRARY`
              [ -n "$GRAILS_HOME" ] &&
                  AGENT_STRING=`echo "-javaagent:$AGENT_GRAILS_JAR -noverify -Dspringloaded=profile=grails"`
          fi
          

          You are defining AGENT_STRING twice, which is overriden below on line 195 :

          # Process JVM args
          AGENT_STRING="-javaagent:$AGENT_GRAILS_HOME/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.2.jar -noverify -Dspringloaded=profile=grails"
          
          Show
          Guillaume Balaine added a comment - - edited Actually you made a mistake when adding your fix. Sorry about that. The lines you added don't make sense at all : AGENT_LIBRARY= "lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.1.jar" AGENT_STRING= "-javaagent:$AGENT_GRAILS_HOME/$AGENT_LIBRARY -noverify -Dspringloaded=profile=grails" if $mingw ; then AGENT_GRAILS_JAR=`cmd //C echo $AGENT_GRAILS_HOME/$AGENT_LIBRARY` [ -n "$GRAILS_HOME" ] && AGENT_STRING=`echo "-javaagent:$AGENT_GRAILS_JAR -noverify -Dspringloaded=profile=grails" ` fi You are defining AGENT_STRING twice, which is overriden below on line 195 : # Process JVM args AGENT_STRING= "-javaagent:$AGENT_GRAILS_HOME/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.2.jar -noverify -Dspringloaded=profile=grails"
          Hide
          Rob Elsner added a comment -

          I added my code to mimic the cygwin code.

          Show
          Rob Elsner added a comment - I added my code to mimic the cygwin code.
          Hide
          Rob Elsner added a comment -

          I will clean up the script, though now you point this out I'm unsure why it worked!

          Show
          Rob Elsner added a comment - I will clean up the script, though now you point this out I'm unsure why it worked!
          Hide
          Rob Elsner added a comment -

          Guillaume Balaine can you take a look at the latest commit. I've cleaned up the script so I'd like to know if it works for you as well.

          Show
          Rob Elsner added a comment - Guillaume Balaine can you take a look at the latest commit. I've cleaned up the script so I'd like to know if it works for you as well.
          Hide
          Damien White added a comment -

          Any progress on this?

          Show
          Damien White added a comment - Any progress on this?
          Hide
          Peter Ledbrook added a comment -

          I tried adding this to the startGrails script and it seems to work fine:

          if $mingw ; then
              [ -n "$GRAILS_HOME" ] &&
                  AGENT_GRAILS_HOME=`cmd //C echo "$GRAILS_HOME"`
          fi
          

          Please try it our on your own Grails installations to verify that it works. The code goes just before the equivalent Cygwin block:

          if $cygwin ; then
              [ -n "$GRAILS_HOME" ] &&
                  AGENT_GRAILS_HOME=`cygpath --windows "$GRAILS_HOME"`
          fi
          
          Show
          Peter Ledbrook added a comment - I tried adding this to the startGrails script and it seems to work fine: if $mingw ; then [ -n "$GRAILS_HOME" ] && AGENT_GRAILS_HOME=`cmd //C echo "$GRAILS_HOME" ` fi Please try it our on your own Grails installations to verify that it works. The code goes just before the equivalent Cygwin block: if $cygwin ; then [ -n "$GRAILS_HOME" ] && AGENT_GRAILS_HOME=`cygpath --windows "$GRAILS_HOME" ` fi
          Hide
          Peter Ledbrook added a comment -

          See the git commits tab for info. The startGrails script now determines whether it's running in a mingw bash and if so, converts the MSys path for GRAILS_HOME to Windows native.

          Show
          Peter Ledbrook added a comment - See the git commits tab for info. The startGrails script now determines whether it's running in a mingw bash and if so, converts the MSys path for GRAILS_HOME to Windows native.

            People

            • Assignee:
              Peter Ledbrook
              Reporter:
              Rob Elsner
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Last Reviewed: