So I modified the way of finding the class in the generic type. Instead of using Class.forName I used Field#getDeclaringClass#getClassLoader.loadClass
So I modified the way of finding the class in the generic type. Instead of using Class.forName I used Field#getDeclaringClass#getClassLoader.loadClass