@Override protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { try { // first we try to find a class inside the child class loader return childClassLoader.findClass(name); } catch( ClassNotFoundException e ) { // didn't find it, try the parent return super.loadClass(name, resolve); } } }
public ParentLastURLClassLoader(URL[] urls) { super(Thread.currentThread().getContextClassLoader()); childClassLoader = new ChildURLClassLoader(urls, new FindClassClassLoader(this.getParent())); }