Details
-
Bug
-
Resolution: Done
-
Minor
-
EAP_EWP 5.1.0
-
None
-
JBoss EAP 5.1.0 running on Windows through CYGWIN
-
-
-
Documented as Resolved Issue
-
ASSIGNED
Description
When twiddle.sh is run through CYGWIN in Windows from an installation with a space in its path (e.g. C:\Program Files\...), it fails with a NoClassDefFoundError:
java.lang.NoClassDefFoundError: Files\EnterprisePlatform-5/1/0\jboss-eap-5/1\jboss-as\bin\twiddle/jar;c:\Program
Caused by: java.lang.ClassNotFoundException: Files\EnterprisePlatform-5.1.0\jboss-eap-5.1\jboss-as\bin\twiddle.jar;c:\Program
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Files\EnterprisePlatform-5.1.0\jboss-eap-5.1\jboss-as\bin\twiddle.jar;c:\Program. Program will exit.
Exception in thread "main"
The root cause of this is this last portion of the script that initializes the twiddle java process:
exec "$JAVA" \
$JAVA_OPTS \
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dprogram.name="$PROGNAME" \
-classpath $JBOSS_CLASSPATH \
org.jboss.console.twiddle.Twiddle "$@"
In this current state, if the JBOSS_CLASSPATH has a space in it, it will be split and treated as two different arguments, explaining the error. By quoting $JBOSS_CLASSPATH, this will now be treated as one argument again even with spaces. Attached is twiddle.sh with this fix.