Search code examples
javajavers

JaversException PROPERTY_ACCESS_ERROR: error getting value from property 'Method ClassRepository getGenericInfo


I seem to get this error on many classes I'm trying to log (though not all). It looks like a common error, wonder if anyone else saw this and how it got solved.

JaversException PROPERTY_ACCESS_ERROR: error getting value from property 'Method ClassRepository getGenericInfo; //declared in: Class' on target object of type 'Class', cause: java.lang.reflect.InvocationTargetException: null


Solution

  • getGenericInfo() is the method declared in Class class. If you trying to compare classes (objects of type Class) that's not going to work by default. There should be a Custom Comparator for Class type, which would compare class by name.

    javersBuilder.registerValue(Class.class, (a,b) -> a.getName().equals(b.getName());