private ClassLoader createClassLoader(AbstractArchive archive, URL[] persistenceURLs)
throws IOException {
List<String> paths = getClassPaths(archive);
ClassLoader parent = Thread.currentThread().getContextClassLoader();
EJBClassLoader loader = new EJBClassLoader(parent);
final int LIST_SZ = paths.size();
for (int i=0; i<LIST_SZ; i++) {
String path = paths.get(i);
loader.appendURL(new File(path));
}
if (_logger.isLoggable(Level.FINE)) {
for (int i = 0; i < paths.size(); i++) {
_logger.fine("Added path to classloader ==> " + paths.get(i));
}
}
for (URL url : persistenceURLs) {
loader.appendURL(url);
_logger.fine("Added path to classloader ==> " + url);
}
return loader;
}