@Ernest
Thanks Ernest. It worked after inserting "/" before the resName.
@Norm
Yes, resName is the name of the file, with the path. If 'name' is "test.pack.MyClass", 'resName' will be "test/pack/MyClass.class".
However, since I was using the class loader from the class itself, it was
not the relative path to the actual class file. That caused the problem, as Ernest pointed.
Thanks a lot guys.