Himanshu Gupta wrote:This is some pre-written code and I am trying to make it run. I think I have to look deeper in this to get it resolved.
If I dont extend the Agent class by JobClassLoader is there any way I can make the following code return the JobClassLoader?
You forgot to post the "following" code.
As for looking deeper into it, I would definitely agree. To me a class hierarchy of what appears to be business objects descending from a ClassLoader is quite bizarre and quite possibly a candidate for the Daily WTF. But all I have seen is the class hierarchy so there may be a good reason for having done that. Or at least a reason...
Rob Spoor wrote:a's class needs to be loaded by your own class loader. That means that, first of all, its parent class loader should not load it. And that in turn means that the class to be loaded cannot be on the class path. After all, everything on the class path will already be found by the system class loader. A class loader will only be asked to load a class if its parent can't find it.
That was the real issue.