Bug 1039860 - Server cannot start if server path contains two consecutive spaces
Summary: Server cannot start if server path contains two consecutive spaces
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Server
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: DR3
: EAP 6.4.0
Assignee: baranowb
QA Contact: Martin Svehla
URL:
Whiteboard:
Depends On:
Blocks: 1053028
TreeView+ depends on / blocked
 
Reported: 2013-12-10 08:12 UTC by Tran Trung Thanh
Modified: 2019-08-02 07:30 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-08-02 07:30:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1053213 0 unspecified CLOSED .bat files refer to issues with space char in directories - but users can install and run successfully into dirs with on... 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker JBEAP-40 0 Minor Resolved Server cannot start if server path contains two consecutive spaces 2017-08-09 19:07:21 UTC
Red Hat Issue Tracker WFCORE-93 0 Minor Resolved Server cannot start if server path contains two consecutive spaces 2017-08-09 19:07:21 UTC
Red Hat Issue Tracker WFLY-3829 0 Minor Resolved Server cannot start if server path contains two consecutive spaces 2017-08-09 19:07:21 UTC

Internal Links: 1053213

Description Tran Trung Thanh 2013-12-10 08:12:07 UTC
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:

Comment 1 Francisco Canas 2014-01-14 19:45:26 UTC
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.

Comment 2 baranowb 2014-09-09 06:49:33 UTC
This affects all scripts.

Comment 3 JBoss JIRA Server 2014-09-10 07:53:15 UTC
Bartosz Baranowski <bbaranow> updated the status of jira WFCORE-93 to Coding In Progress

Comment 4 JBoss JIRA Server 2014-09-10 07:55:49 UTC
Bartosz Baranowski <bbaranow> updated the status of jira WFLY-3829 to Coding In Progress

Comment 7 Martin Svehla 2014-10-03 06:47:44 UTC
Verified with EAP 6.4.0.DR3. Thanks

Comment 8 JBoss JIRA Server 2014-10-15 11:16:40 UTC
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-40 to Resolved


Note You need to log in before you can comment on or make changes to this bug.