Details
Description
The setupClasspath method in the DynamicClientFactory class cannot handle spaces in the path to jar files. It throws the following exception:
Caused by: java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Program Files/Apache/Tomcat-5.5.20/common/i18n/tomcat-i18n-en.jar
at java.net.URI$Parser.fail(URI.java:2816)
at java.net.URI$Parser.checkChars(URI.java:2989)
at java.net.URI$Parser.parseHierarchical(URI.java:3073)
at java.net.URI$Parser.parse(URI.java:3021)
at java.net.URI.<init>(URI.java:578)
at java.net.URL.toURI(URL.java:916)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.setupClasspath(DynamicClientFactory.java:405)
This is a know issue withthe URL.toURI() method.
A possible solution would be to replace the following:
if (url.getProtocol().startsWith("file")) {
try {
File file = new File(url.toURI().getPath());
if (file.exists())
if (file.getName().endsWith(".jar"))
{ addClasspathFromManifest(classPath, file); }} catch (URISyntaxException e)
{ throw new UncheckedException(e); }}
with
if (url.getProtocol().startsWith("file")) {
File file;
try
catch (catch catch(URISyntaxException urise)
{ file = new File(url.getPath()); }if (file.exists())
{ classPath.append(file.getAbsolutePath()) .append(System .getProperty("path.separator")); }if (file.getName().endsWith(".jar"))
{ addClasspathFromManifest(classPath, file); }}