jeudi 5 novembre 2020

Library which is using reflection cant find my class

When i try to load a class by its name during runtime on my own, it works fine.

Class.forName("com.test.Task");

When i use a jar file (library) which provides a method that wraps this "Class.forName", it does not work and throws me an exception.


public static Class forName(String name) throws ReflectionException {
     try {
         return Class.forName(name);
      catch (ClassNotFoundException var2) {
         throw new ReflectionException("Class not found: " + name, var2);
     }
}

ClassReflection.forName("com.test.Task");

Any idea why this might happen and how i can solve this ?





Aucun commentaire:

Enregistrer un commentaire