I am using a class loader and in one instance, it works perfectly fine, and then in another instance I get a ClassNotFoundException when trying to load a class, particularly on the loadClass() method.
Here is the background information: I am developing a website using MyEclipse and it is being ran on a JRun server. The instance on when the class loader works correctly is when the class I am trying to load is in a separate jar folder that has been included in the web project's class path. The instance where it throws the ClassNotFoundException is when the class is in a package in the web project itself. Now, the class loader is in a separate jar folder from the project.
Why is the class loader throwing the exception when the class it is trying to load is in the webproject itself but not when it is in a separate jar? Shouldn't it be able to find it when it is in the webproject?
Since you haven't actually told us anything about how your ClassLoader finds and loads classes, anything is possible. You also haven't mentioned whether you're following the delegation model correctly. Describe the custom ClassLoader, and maybe we'll see what's wrong with it.