posted 13 years ago
That would probably solve it. I'm wondering why you are loading the class dynamically if you can also load it statically; since you are already using LDAPManager.class, why not simply use LDAPManager.getInstance()? Or is LDAPManager's class loader a custom one (URLClassLoader perhaps), and you want to load the class again? Then I have bad news for you: if the parent class loader could load the class, it already would have, and otherClassInstance == LDAPManager.class (provided it worked). If the parent class loader couldn't load the class before, it still can't now.
So either in the end, otherClassInstance == LDAPManager.class, or there will be a ClassNotFoundException.
To prevent this, either add the JAR file to your class path (in which case you can just use LDAPManager.getInstance()), or create a new class loader to load the class.