Details
Description
If a jar file reported by the classloader does not exist, the following exception is thrown:
Caused by: java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:203)
at java.util.jar.JarFile.<init>(JarFile.java:132)
at java.util.jar.JarFile.<init>(JarFile.java:97)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.addClasspathFromManifest(DynamicClientFactory.java:366)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.setupClasspath(DynamicClientFactory.java:422)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:214)
... 54 more
As the code does not display the file in question, it is a very tedious process to find the issue in the classpath. It would be prefferable if the code would ignore any missing jar file. Another possible solution (though less preferrable) would be to print the jar files as they are added.
Code in question:
if (file.exists())
if (file.getName().endsWith(".jar"))
{ addClasspathFromManifest(classPath, file); }The following code should fix the issue:
if (file.exists()) {
classPath.append(file.getAbsolutePath())
.append(System
.getProperty("path.separator"));
if (file.getName().endsWith(".jar"))
}