Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1039860

Summary: Server cannot start if server path contains two consecutive spaces
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Tran Trung Thanh <thanhtt>
Component: ServerAssignee: baranowb <bbaranow>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Svehla <msvehla>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbaranow, jperkins, kkhan, msvehla, pkremens, trangvh
Target Milestone: DR3   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-02 07:30:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1053028    

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