Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1
-
None
-
Websphere 6.1.0.7, jdk 1.5.09, Solaris
-
Novice
Description
On WAS, one of the ExtClassCloader returns a null instead of an empty array when getUrls is called.
Stack trace:
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:215)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:150)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:129)
at mil.af.ilss.common.service.WebServiceUtil.invokeWebService(WebServiceUtil.java:43)
... 1 more
Caused by: java.lang.NullPointerException
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.setupClasspath(DynamicClientFactory.java:404)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:213)
The following is the list of classloaders in order:
com.ibm.ws.classloader.CompoundClassLoader Delegation Mode: PARENT_FIRST
com.ibm.ws.classloader.JarClassLoader Delegation mode: PARENT_LAST
com.ibm.ws.classloader.ProtectionClassLoader
com.ibm.ws.bootstrap.ExtClassLoader
The following code should fix the issue. setupClasspath method line 402:
if (tcl instanceof URLClassLoader) {
URL[] urls = ((URLClassLoader)tcl).getURLs();
if (urls != null) {
for (URL url : urls) {
if (url.getProtocol().startsWith("file")) {
File file;
try
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); }
}
}
}
}
}