Bug 1411996 - rhqctl fails if JAVA_HOME contains a space
Summary: rhqctl fails if JAVA_HOME contains a space
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Launch Scripts
Version: JON 3.3.7
Hardware: Unspecified
OS: Linux
Target Milestone: ---
: ---
Assignee: Michael Burman
QA Contact: Mike Foley
Depends On:
TreeView+ depends on / blocked
Reported: 2017-01-10 23:35 UTC by Larry O'Leary
Modified: 2017-02-16 20:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-02-16 20:11:36 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1404820 0 high CLOSED apply-updates.bat on Windows does not property quote/escape RHQ_JAVA_EXE_FILE_PATH 2021-02-22 00:41:40 UTC

Internal Links: 1404820

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):

How reproducible:

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.

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