lundi 2 février 2015

Java reflection java.lang.NoClassDefFoundError dependencies

I am trying to get methods, fields, constructors using reflection API. I am trying to use getFields(),getDeclaredMethods... But unfortunatly I get java.lang.NoClassDefFoundError. I am trying to load class files from jar archive using custom class loader. But I guess I need to resolve dependencies, if this class includes another class objects of this jar package.



clazz = Class.forName(className,false,classLoader);
Methods[] methods = clazz.getDeclaredMethods();


Is it possible to get these methods,fields ... loading class from jar file.






Aucun commentaire:

Enregistrer un commentaire