mardi 28 août 2018

BeanUtils NoSuchMethodError

I want to set custom data into the fields of my class in this example its 'obj' i get this error:

java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)
    at org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:418)
    at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1002)
    at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:313)

'the field exists the name of the field is correct (private String 'mymiddleName') I dont know what the problem is

for(Map.Entry<String, Object> entry : customValues.entrySet()) {
        for(Field field : myFields){
            if(field.getName().equals(entry.getKey())) {
                System.out.println("key: " + entry.getKey() + " Value:" + entry.getValue());
                BeanUtils.setProperty(obj, entry.getKey(), entry.getValue());
                break;
            }
        }
    }

Excuse my bad english skills i work on it.





Aucun commentaire:

Enregistrer un commentaire