Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3740

standalone.sh does not compute correct module path in Cygwin

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Minor
    • 10.0.0.CR3
    • 8.1.0.Final
    • Scripts
    • None
    • Hide

      Run standalone.sh to start the server from a Cygwin shell.

      Show
      Run standalone.sh to start the server from a Cygwin shell.
    • Low

    Description

      standalone.sh does not seem to compute the correct JBOSS_MODULEPATH on Cygwin as a result, starting up the server gives the following error:

      org.jboss.modules.ModuleNotFoundException: org.jboss.as.standalone:main
              at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:240)
              at org.jboss.modules.Main.main(Main.java:385)}}
      

      The problem seems to be somewhat related to this issue in that a mix of Windows and Unix style paths are being computed: WFLY-2523

      Since JBOSS_MODULEPATH is not set until after all the paths (such as JBOSS_HOME) have been converted to Windows style, JBOSS_MODULEPATH ends up with a Unix style forward slash at the end of what is otherwise a Windows style path.

      The fix for me was to move the code which sets the JBOSS_MODULEPATH to earlier in the script. I moved it to right after the export JBOSS_HOME line:

      standalone.sh
      ...
      export JBOSS_HOME
      
      if [ "x$JBOSS_MODULEPATH" = "x" ]; then
          JBOSS_MODULEPATH="$JBOSS_HOME/modules"
      fi
      
      ...
      

      Probably the key thing is just that the JBOSS_MODULEPATH gets set before everything is switched to Windows paths in this section of the script:

      standalone.sh
      # For Cygwin, switch paths to Windows format before running java
      if $cygwin; then
          JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
          JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
          JBOSS_MODULEPATH=`cygpath --path --windows "$JBOSS_MODULEPATH"`
          JBOSS_BASE_DIR=`cygpath --path --windows "$JBOSS_BASE_DIR"`
          JBOSS_LOG_DIR=`cygpath --path --windows "$JBOSS_LOG_DIR"`
          JBOSS_CONFIG_DIR=`cygpath --path --windows "$JBOSS_CONFIG_DIR"`
      fi
      

      Attachments

        Activity

          People

            tomazcerar Tomaž Cerar (Inactive)
            ddelvecc_jira David Del Vecchio (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: