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

Bug 900592 (JBPAPP6-1087)

Summary: Some script utilities don't work correctly on Windows, if $JBOSS_HOME or $JAVA_HOME variables contain space symbols
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Vladimir Rastseluev <vrastsel>
Component: Scripts and CommandsAssignee: Paul Gier <pgier>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: heapifyman, pgier, pslavice, trogers, vrastsel
Target Milestone: ---   
Target Release: EAP 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBPAPP6-1087
Whiteboard: eap601candidate
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Windows Vista 6, Windows 7, Windows XP
Last Closed: 2012-10-26 10:52:50 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: 900553    
Attachments:
Description Flags
0001-JBPAPP-9249-Fix-jconsole.bat-and-vault.bat-scripts-f.patch none

Description Vladimir Rastseluev 2012-06-05 13:18:01 UTC
Affects: Release Notes
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A000000Atryk
Steps to Reproduce: Place EAP instantion in directory with path, containning spaces or place java JDK to such directory and set $JAVA_HOME to this path.
Workaround: Workaround Exists
Workaround Description: Don't use spaces in path to $JAVA_HOME and $JBOSS_HOME
project_key: JBPAPP6

Utilities vault.bat and jconsole.bat don't work correctly, if path to $JAVA_HOME or $JBOSS_HOME (directory, where EAP placed) contains space symbol, e.g. $JAVA_HOME="C:\Program Files\java".

Comment 1 Rostislav Svoboda 2012-06-05 14:42:12 UTC
Paul, please assign to the best person.

Comment 2 Paul Gier 2012-06-05 15:04:57 UTC
Can you provide more information about in what way they do not work?  Maybe command line output of error messages?

Comment 3 Vladimir Rastseluev 2012-06-06 08:47:30 UTC
Problem is in not using quotes in scripts.
In vault.bat in this fragment:
IF DEFINED JAVA_HOME (
   set JAVA=%JAVA_HOME%\bin\java
if $JAVA_HOME contains spaces, script doesn't start java command. To fix, use set JAVA="%JAVA_HOME%\bin\java" instead.
The similar error is in this fragment:
IF NOT DEFINED MODULEPATH (
    set MODULEPATH=%JBOSS_HOME%\modules
)

rem 
rem Setup the JBoss Vault Tool classpath
rem

rem Shared libs
set JBOSS_VAULT_CLASSPATH=%MODULEPATH%\org\picketbox\main\*
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;%MODULEPATH%\org\jboss\logging\main\*
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;%MODULEPATH%\org\jboss\common-core\main\*
set JBOSS_VAULT_CLASSPATH=%JBOSS_VAULT_CLASSPATH%;%MODULEPATH%\org\jboss\as\security\main\*

if path to directory, where EAP placed contains spaces we get ClassNotFoundException, trying to run java command.

In jconsole.bat in this fragment:
set CLASSPATH=%JAVA_HOME%\lib\jconsole.jar
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar

call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\remoting3\remoting-jmx\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\remoting3\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\logging\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\xnio\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\xnio\nio\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\sasl\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\marshalling\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\marshalling\river\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\as\cli\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\staxmapper\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\as\protocol\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\dmr\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\as\controller-client\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\threads\main
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\as\controller\main

I got 15 messages like "Path not found". 
It's possible to start console in this case, but without some options, e.g. CLI GUI.


Comment 4 Vladimir Rastseluev 2012-06-06 08:55:16 UTC
Steps to Reproduce: Added: Place EAP instantion in directory with path, containning spaces or place java JDK to such directory and set $JAVA_HOME to this path.
Workaround Description: Added: Don't use spaces in path to $JAVA_HOME and $JBOSS_HOME
Workaround: Added: Workaround Exists


Comment 5 Rostislav Svoboda 2012-06-07 09:12:45 UTC
Link: Added: This issue is a dependency of JBPAPP-9188


Comment 6 Rajesh Rajasekaran 2012-07-11 19:51:43 UTC
Labels: Added: eap601candidate


Comment 8 Travis Rogers 2012-09-29 03:27:30 UTC
With respect to jboss-eap-6.0\bin\jconsole.bat.

The issue is the way the jar file names are "discovered" using the SearchForJars routine.  The entire path being passed to SearchForJars and the discovered jar files should be surrounded in double quotes to prevent the spaces from causing an issue.

Simple way to test is by adding an echo statement just before the pushd in SearchForJars.  This will show that the path being passed in is truncated at the first space.

For example:
Current directory is C:\Program Files\jboss-eap-6.0.
JBOSS_HOME=C:\Program Files\jboss-eap-6.0
JBOSS_MODULEPATH=C:\Program Files\jboss-eap-6.0\modules

First call to SearchForJars:
call :SearchForJars %JBOSS_MODULEPATH%\org\jboss\remoting3\remoting-jmx\main

:SearchForJars
echo %1
pushd %1


The echo will print out:
C:\Program

JConsole will start, but no modules are added to the classpath.


Comment 9 Travis Rogers 2012-09-29 03:44:03 UTC
Help Desk Ticket Reference: Added: https://c.na7.visual.force.com/apex/Case_View?id=500A000000Atryk


Comment 10 Paul Gier 2012-10-02 23:38:39 UTC
Attachment: Added: 0001-JBPAPP-9249-Fix-jconsole.bat-and-vault.bat-scripts-f.patch


Comment 11 Paul Gier 2012-10-02 23:41:27 UTC
I made changes to vault.bat and jconsole.bat to allow them to work when the paths have spaces.  I did notice that paths which include strange characters like "&" still don't work, but hopefully it's acceptable to require users to not use these paths.

http://git.app.eng.bos.redhat.com/?p=jbossas/jboss-as.git;a=commitdiff;h=750140f79d2e4c3d2eaaed8a354aa54fe96ce751

Comment 12 Dana Mison 2012-10-19 04:40:11 UTC
Affects: Added: Release Notes


Comment 13 Dana Mison 2012-10-19 06:04:55 UTC
updated info for the EAP6.0.1 release notes

Comment 14 Dana Mison 2012-10-19 06:04:55 UTC
Release Notes Docs Status: Added: Documented as Resolved Issue
Writer: Added: Darrin
Release Notes Text: Added: Running the vault.bat and jconsole.bat scripts would fail if JBoss Enterprise Application Platform 6 or the Java Virtual Machine were installed in directories that contained spaces in their paths.  The scripts would fail to launch correctly and return several "Path not found" error messages. These two scripts have been updated to correctly deal with paths containing spaces. The vault.bat and jconsole.bat scripts now run correctly when the installation paths include spaces.


Comment 15 Dana Mison 2012-10-19 06:05:18 UTC
Release Notes Text: Removed: Running the vault.bat and jconsole.bat scripts would fail if JBoss Enterprise Application Platform 6 or the Java Virtual Machine were installed in directories that contained spaces in their paths.  The scripts would fail to launch correctly and return several "Path not found" error messages. These two scripts have been updated to correctly deal with paths containing spaces. The vault.bat and jconsole.bat scripts now run correctly when the installation paths include spaces. Added: Running the vault.bat and jconsole.bat scripts on Microsoft Windows would fail if JBoss Enterprise Application Platform 6 or the Java Virtual Machine were installed in directories that contained spaces in their paths.  The scripts would fail to launch correctly and return several "Path not found" error messages. These two scripts have been updated to correctly deal with paths containing spaces. The vault.bat and jconsole.bat scripts now run correctly when the installation paths include spaces.


Comment 16 Dana Mison 2012-10-19 06:05:47 UTC
Release Notes Text: Removed: Running the vault.bat and jconsole.bat scripts on Microsoft Windows would fail if JBoss Enterprise Application Platform 6 or the Java Virtual Machine were installed in directories that contained spaces in their paths.  The scripts would fail to launch correctly and return several "Path not found" error messages. These two scripts have been updated to correctly deal with paths containing spaces. The vault.bat and jconsole.bat scripts now run correctly when the installation paths include spaces. Added: Running the vault.bat and jconsole.bat scripts on Microsoft Windows would fail if JBoss Enterprise Application Platform 6 or the Java Virtual Machine were installed in directories that contained spaces in their paths.  The scripts would fail to launch correctly and returned several "Path not found" error messages. These two scripts have been updated to correctly deal with paths containing spaces. The vault.bat and jconsole.bat scripts now run correctly when the installation paths include spaces.


Comment 17 Vladimir Rastseluev 2012-10-26 10:52:50 UTC
Verified on EAP 6.0.1 ER3

Comment 18 Paul Gier 2012-10-30 13:54:13 UTC
Link: Added: This issue Cloned to JBPAPP-10298


Comment 19 Anne-Louise Tangring 2012-11-13 20:24:16 UTC
Release Notes Docs Status: Removed: Documented as Resolved Issue 
Writer: Removed: Darrin 
Release Notes Text: Removed: Running the vault.bat and jconsole.bat scripts on Microsoft Windows would fail if JBoss Enterprise Application Platform 6 or the Java Virtual Machine were installed in directories that contained spaces in their paths.  The scripts would fail to launch correctly and returned several "Path not found" error messages. These two scripts have been updated to correctly deal with paths containing spaces. The vault.bat and jconsole.bat scripts now run correctly when the installation paths include spaces. 
Docs QE Status: Removed: NEW 


Comment 20 Travis Rogers 2012-11-15 18:47:58 UTC
Link: Added: This issue Cloned to JBPAPP6-1632