Issue Details (XML | Word | Printable)

Key: RIO-189
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dennis Reedy
Reporter: Jeff Ramsdale
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Rio

rio.cmd doesn't handle paths containing spaces

Created: 24/Jul/09 08:55 AM   Updated: 17/Feb/10 05:05 PM
Component/s: Core
Affects Version/s: 4.0 M2
Fix Version/s: 4.0

Time Tracking:
Not Specified

Environment: Windows XP


 Description  « Hide
Using Rio 4.0 M2 as provided by the Rio Installer for Windows fails when installed in the default location (Program Files). Rio is therefore likely to be broken for most Windows users. I haven't tried it on Linux, but it wouldn't be surprising if directories with spaces fail with the shell script too. (Since dirs with spaces are rare in *nix they aren't often tested.)

Any of JAVA_HOME, JINI_HOME, RIO_HOME, and the dir in which a config file resides may have spaces (the latter is actually a separate bug as it impacts Java code). In fact, in the default location on Windows all of them will.

I've created a patch that may fix the bug. If it doesn't I believe it at least makes some progress.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Ramsdale added a comment - 24/Jul/09 08:58 AM
Hmmm... Not seeing where I can attach a patch file? Enclosing it, then... This patch applies to rio.cmd.

16c16
< set JINI_HOME=%RIO_HOME%\lib\apache-river

> set JINI_HOME="%RIO_HOME%\lib\apache-river"
28c28
< set JAVACMD=%JAVA_HOME%\bin\java.exe

> set JAVACMD="%JAVA_HOME%\bin\java.exe"
42c42
< rem set cliExt=%RIO_HOME%\config\rio_cli.groovy

> rem set cliExt=%RIO_HOME%\config\rio_cli.config
46,49c46,49
< set classpath=-cp "%RIO_HOME%\lib\rio-cli.jar";"%JINI_LIB%\jsk-lib.jar";"%JINI_LIB%\jsk-platform.jar";"%RIO_HOME%\lib\spring\spring.jar";"%RIO_HOME%\lib\jakarta-commons\commons-logging.jar";"%RIO_HOME%\lib\groovy\groovy-all-1.6.0.jar";
< set props="-DRIO_HOME=%RIO_HOME% -DJINI_HOME=%JINI_HOME%"
< "%JAVACMD%" %classpath% -Xms256m -Xmx256m ^
< -DRIO_HOME=%RIO_HOME% -DJINI_HOME=%JINI_HOME% -Djava.security.policy=%RIO_HOME%\policy\policy.all ^

> set classpath=-cp "%RIO_HOME%\lib\rio-cli.jar;%JINI_LIB%\jsk-lib.jar;%JINI_LIB%\jsk-platform.jar;%RIO_HOME%\lib\spring\spring.jar;%RIO_HOME%\lib\jakarta-commons\commons-logging.jar;%RIO_HOME%\lib\groovy\groovy-all-1.6-RC-1.jar"
> set props=-DRIO_HOME="%RIO_HOME%" -DJINI_HOME="%JINI_HOME%"
> %JAVACMD% %classpath% -Xms256m -Xmx256m ^
> -DRIO_HOME="%RIO_HOME%" -DJINI_HOME="%JINI_HOME%" -Djava.security.policy="%RIO_HOME%\policy\policy.all" ^
58c58
< set starterConfig="%RIO_HOME%\config\start-%1.groovy"

> set starterConfig="%RIO_HOME%\config\start-%1.config"
63,65c63,65
< set RIO_LOG_DIR="%RIO_HOME%"\logs\
< set RIO_NATIVE_DIR="%RIO_HOME%"\lib\native
< set PATH=%PATH%;"%RIO_NATIVE_DIR%

> set RIO_LOG_DIR="%RIO_HOME%\logs\"
> set RIO_NATIVE_DIR="%RIO_HOME%\lib\native"
> set PATH=%PATH%;%RIO_NATIVE_DIR%
67c67
< set classpath=-cp "%RIO_HOME%\lib\boot.jar";"%JINI_HOME%\lib\start.jar";"%JAVA_HOME%\lib\tools.jar";"%RIO_HOME%\lib\groovy\groovy-all-1.6.0.jar";

> set classpath=-cp "%RIO_HOME%\lib\boot.jar;%JINI_HOME%\lib\start.jar;%JAVA_HOME%\lib\tools.jar;"
73c73
< -Djava.security.policy=%RIO_HOME%\policy\policy.all ^

> -Djava.security.policy="%RIO_HOME%\policy\policy.all" ^
75,81c75,80
< -Djava.library.path=%RIO_NATIVE_DIR% ^
< -DJINI_HOME=%JINI_HOME% ^
< -DRIO_HOME=%RIO_HOME% ^
< -Dorg.rioproject.home=%RIO_HOME% ^
< -DRIO_NATIVE_DIR=%RIO_NATIVE_DIR% ^
< -DRIO_LOG_DIR=%RIO_LOG_DIR% ^
< -Drio.script.mainClass=%launchTarget% ^

> -Djava.library.path="%RIO_NATIVE_DIR%" ^
> -DJINI_HOME="%JINI_HOME%" ^
> -DRIO_HOME="%RIO_HOME%" ^
> -Dorg.rioproject.home="%RIO_HOME%" ^
> -DRIO_NATIVE_DIR="%RIO_NATIVE_DIR%" ^
> -DRIO_LOG_DIR="%RIO_LOG_DIR%" ^
87c86
< echo Cannot locate expected service starter file [start-%1.config] in [%RIO_HOME%\config], exiting"

> echo "Cannot locate expected service starter file [start-%1.config] in [%RIO_HOME%\config], exiting"


Dennis Reedy added a comment - 24/Jul/09 02:10 PM
This has already been addressed in svn head

Jeff Ramsdale added a comment - 05/Aug/09 01:35 AM
I'm still seeing this problem:

C:\workspaces\Research\rio project\bin>startall
The system cannot find the path specified.
"starter config ["C:\workspaces\Research\rio project\bin\..\config\start-all.groovy"]"
Exception in thread "main" java.lang.NoClassDefFoundError: project\bin\//\policy\policy/all
Caused by: java.lang.ClassNotFoundException: project\bin\..\policy\policy.all
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: project\bin\..\policy\policy.all. Program will exit.

C:\workspaces\Research\rio project\bin>