Description of problem: Server cannot start if server path contains two consecutive spaces How reproducible: Steps to Reproduce: 1.Extract Jboss EAP to a directory which contains two consecutive spaces 2.Start server Actual results: Exception, server cannot start {noformat} ./bin/standalone.sh JAVA_OPTS already set in environment; overriding default settings with values: -Xshare:auto -Xms256m -Xmx4G -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -Dexo.directory.base=/home/thanhtt/java ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /home/example/java/jboss-eap/a a JAVA: /home/example/java/jdk1.6/bin/java JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xshare:auto -Xms256m -Xmx4G -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -Dexo.directory.base=/home/example/java ========================================================================= Unable to access jarfile /home/example/java/jboss-eap/a a/jboss-modules.jar {noformat} Expected results: - Server can start Additional info:
This issue also affects add-user.sh and domain.sh. See: https://bugzilla.redhat.com/show_bug.cgi?id=1053028 Issue is caused because the variables holding directory information (JBOSS_HOME, for example) are only quoted for the resulting java command, but not for bash itself so the consecutive spaces get compressed into one. The solution may be to add unescaped quotes around each of the variables, so that bash passes the directory with the consecutive spaces to the java command. For example, in the add-user.sh script, line 66: eval \"$JAVA\" $JAVA_OPTS \ -jar \"$JBOSS_HOME/jboss-modules.jar\" \ -mp \"${JBOSS_MODULEPATH}\" \ org.jboss.as.domain-add-user \ '"$@"' The variables that contain paths need to be double quoted: eval \""$JAVA"\" $JAVA_OPTS \ -jar \""$JBOSS_HOME"/jboss-modules.jar\" \ -mp \""${JBOSS_MODULEPATH}"\" \ org.jboss.as.domain-add-user \ '"$@"' These changes must be made in the domain.sh and standalone.sh scripts as well.
This affects all scripts.
Bartosz Baranowski <bbaranow> updated the status of jira WFCORE-93 to Coding In Progress
Bartosz Baranowski <bbaranow> updated the status of jira WFLY-3829 to Coding In Progress
Verified with EAP 6.4.0.DR3. Thanks
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-40 to Resolved