Bug 1411996

Summary: rhqctl fails if JAVA_HOME contains a space
Product: [JBoss] JBoss Operations Network Reporter: Larry O'Leary <loleary>
Component: Launch ScriptsAssignee: Michael Burman <miburman>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.3.7CC: fbrychta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-16 20:11:36 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:

Description Larry O'Leary 2017-01-10 23:35:34 UTC
Description of problem:
If JAVA_HOME is pointing to a JRE that is installed in a path that includes a space, rhqctl fails to run and reports a strange class loading error regarding the main class:

Error: Could not find or load main class runtime.bin.java


Version-Release number of selected component (if applicable):
3.3

How reproducible:
Always

Steps to Reproduce:
1. Extract JBoss ON server archive.
2. Put JRE in a location that contains a space:

        mkdir -p /opt/java\ runtime
        cp -r /usr/lib/jvm/jre-1.7.0/* /opt/java\ runtime

3. Set RHQ_JAVA_HOME to /opt/java\ runtime

        export RHQ_JAVA_HOME="/opt/java runtime"

4. Run rhqctl

        /opt/jboss/on/jon-server/bin/rhqctl status


Actual results:
rhqctl fails and displays:

Error: Could not find or load main class runtime.bin.java

Expected results:
rhqctl should run as normal.

Additional info:
This is due to how RHQ_CONTROL_JAVA_OPTS and the -Drhq.java-exe-file-path setting is defined. Specifically, the path within the system property definition is not get quoted/escaped properly when passed to the JVM command-line resulting in the failure.

Comment 1 Filip Brychta 2017-02-16 20:11:36 UTC
Triage: Larry, Simeon, Filip - This is an edge case. User's would not normally have the JRE installed in a path with a space.Therefore, we will close and won't fix due to the risk necessary to address it.