Commit 43cf1826 authored by Philippe Merle's avatar Philippe Merle

Tried to resolve a build issue on the OW2 Bamboo continuous integration server:

- iterate over the chain of class loaders to keep their JAR URLs.
- display the two arrays of URLs in order to debug the issue on Bamboo.
parent 0fc576c6
......@@ -88,9 +88,21 @@ public class FrascatiTinfiScaParser
// Obtain all URLs of the Juliac class loader.
List<URL> juliacClassLoaderUrls = Arrays.asList(juliacClassLoader.getURLs());
// Obtain the parent of the Juliac class loader.
URLClassLoader parentClassLoader = (URLClassLoader)juliacClassLoader.getParent();
// Obtain all the URLs of the parent of the Juliac class loader.
List<URL> parentClassLoaderUrls = Arrays.asList(parentClassLoader.getURLs());
ClassLoader parentClassLoader = juliacClassLoader.getParent();
// Obtain all the URLs of all the parents of the Juliac class loader.
List<URL> parentClassLoaderUrls = new ArrayList<URL>();
// Iterate over the chain of class loaders.
{
ClassLoader classLoader = parentClassLoader;
while(classLoader != null) {
if(classLoader instanceof URLClassLoader) {
// store URLs of each URL class loader.
parentClassLoaderUrls.addAll(Arrays.asList(((URLClassLoader)classLoader).getURLs()));
}
classLoader = classLoader.getParent();
}
}
// Compute juliacClassLoaderUrls - parentClassLoaderUrls, i.e., all the urls of
// juliacClassLoaderUrls that are not present in parentClassLoaderUrls.
......@@ -103,6 +115,15 @@ public class FrascatiTinfiScaParser
}
}
System.out.println("Parent class loader:");
for(URL url : parentClassLoaderUrls) {
System.out.println("* " + url);
}
System.out.println("FraSCAti class loader:");
for(URL url : urls) {
System.out.println("* " + url);
}
// Create a new class loader with urls and parentClassLoader.
ClassLoader classLoader = new FrascatiClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment