I am loading a class (Student) dynamically from a jar (samplejar.jar) file using URLClassLoader.
Next thing when I want to access method or constructor of the previously loaded class, like this,
Constructor cons = myClass.getConstructor(paramTypes);
I am getting an exception saying:
"java.lang.NoSuchMethodException: samplejar.Student.<init>(int, java.lang.String)"
There is a constructor Student(int, String) defined.
The class from the jar is being loaded properly and I have ensured it.
What might be the reason behind this?