I want to load a file in the directory F:/badge-dao/bin/com/badge/dao/impl/, named BadgeDaoImpl. I am writing and testing the following code.
If I change the directory or the class name, it throws an exception. For the following code, which I suppose should work, it do not throw a classNotFoundException, but rather halts and take the control to EventTable's finally block.
Can you please tell me where I am getting it wrong.
URL[] urls = {new URL("file:/F:/badge-dao/bin/com/badge/dao/impl/")};
ClassLoader parentClassLoader = project.getClass().getClassLoader();
URLClassLoader classLoader = new URLClassLoader(urls, parentClassLoader);
selectedClass = classLoader.loadClass("BadgeDaoImpl");