Community
Participate
Working Groups
The change 3df95d45c27c924c1f0e76c4c16a3f796ddf2470 to fix tests with spaces in them, broke the tests/test-integration monitor tests. These started failing with class not found exceptions. It appears that the quotes are making the JVM think that arguments are actually the main class. I tried making a change so that instead of "-Dname=value" the quoting was done as -Dname="value". This improved it a little, but it still failed with: Running org.eclipse.jetty.test.monitor.JavaMonitorIntegrationTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.003 sec Running org.eclipse.jetty.test.monitor.XmlConfigTest Copying Jetty Distribution: /home/gregw/src/jetty-7/tests/test-integration/target/test-dist/jetty-distribution-7.6.0-SNAPSHOT To Testing Dir: /home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome Executing: /usr/local/jvm/jdk1.6.0_29/jre/bin/java -Djetty.home="/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome" -cp "/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-xml-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/servlet-api-2.5.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-http-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-continuation-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-server-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-security-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-servlet-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-webapp-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-deploy-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-servlets-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-jmx-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jsp/com.sun.el_1.0.0.v201004190952.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jsp/ecj-3.6.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jsp/javax.el_2.1.0.v201004190952.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jsp/javax.servlet.jsp_2.1.0.v201004190952.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jsp/javax.servlet.jsp.jstl_1.2.0.v201004190952.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jsp/org.apache.jasper.glassfish_2.1.0.v201110031002.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jsp/org.apache.taglibs.standard.glassfish_1.2.0.v201004190952.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/resources:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-websocket-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-util-7.6.0-SNAPSHOT.jar:/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/lib/jetty-io-7.6.0-SNAPSHOT.jar" org.eclipse.jetty.xml.XmlConfiguration "/tmp/start8255937009651302414.properties" "/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/etc/jetty-jmx.xml" "/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/etc/jetty.xml" "/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/etc/jetty-deploy.xml" "/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/etc/jetty-webapps.xml" "/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/etc/jetty-contexts.xml" "/home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome/etc/jetty-testrealm.xml" Working Dir: /home/gregw/src/jetty-7/tests/test-integration/target/tests/oejtm.XmlConfigTest/jettyHome [STDERR] Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/xml/XmlConfiguration [STDERR] Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.xml.XmlConfiguration [STDERR] at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [STDERR] at java.security.AccessController.doPrivileged(Native Method) [STDERR] at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [STDERR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [STDERR] Could not find the main class: org.eclipse.jetty.xml.XmlConfiguration. Program will exit. Stopping JettyDistro ... Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 60.985 sec <<< FAILURE! So this looks like the command line is being correctly parsed, but that the classpath is somehow not being interpreted correctly. So Rolling back the change for now.
Instead of rolling back, I've replaced the quotes with a method excapeSpaces that will \ escape strings with spaces in them. This means there is no change to the output if there are no spaces. The it now builds for me. But I leave this open as the full build needs to be tested with spaces in filenames.
I've written a Unit Test which tests spaces in pathnames for: - jetty.home - classpath - xml config files And that jvmArgs are correctly parsed and separated with spaces. I also rewrote the patch. Practically I did intuitively the same thing as greg by writing a escapeSpaces(String) method. It works fine, but classpath needs some more love. Will take care for it tomorrow.
Created attachment 210283 [details] proposed patch - not 100% working yet I've added a Unit Test for building the commandline and fixed the code accordingly. However this patch is not finished, I'm just providing it so Joakim can work on it. The code is not yet beautified and the classpath issue needs to be fixed.
Closing, as we now have working jmx/monitoring/integration tests again.
Created attachment 210339 [details] proposed patch This was a nasty one. I thought 3 or 4 times that I've found the solution, but testing revealed that either the one thing or the other still has not been working. And the solution to get everything working was not the one you'd expect in the beginning. Actually for the classpath you shouldn't escape any space nor add any quotes. Then it works for the build, jetty single jvm start and --exec start. Patch attached.
Reopening for Thomas to continue working failing use case.
applied and tested
The output from --dry-run is not quoted.
Created attachment 210362 [details] fix for --dry-run
Patch finally applied.
closing