Category Archives: apache-commons-beanutils

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/BeanMap

I am trying to use below code for comparing two object values and print the mismtach:

  BeanMap map = new BeanMap(ep);
  PropertyUtilsBean propUtils = new PropertyUtilsBean();
  for (Object propNameObject : map.keySet()) {
     String propertyName = (String) propNameObject;
     Object expectedValue = propUtils.getProperty(ep, propertyName);
     Object actualValue = propUtils.getProperty(ap, propertyName);
     if (!expectedValue.equals(actualValue)) {
        WorkloadGeneratorLogger.log("> " + propertyName
              + " is different (oldValue=\"" + expectedValue
              + "\", newValue=\"" + actualValue + "\")");

Getting below error while using beanMap:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/BeanMap ..................... Caused by: java.lang.ClassNotFoundException:


Below is my pom.xml entries for the same:


Not sure what is being missed here,I tried the same combination of jars suggested by below link:

java.lang.NoClassDefFoundError: org/apache/commons/collections/Transformer

Still unable to sort this out.

commons-beanutils: if set method return is this model, can’t get writeMethod [on hold]

private long payActualMoney; 

public long getPayActualMoney() {
  return this.payActualMoney;

public TAllocate setPayActualMoney(long payActualMoney) {
  this.payActualMoney = payActualMoney;
  return this;

PropertyUtils.getPropertyDescriptors not return payActualMoney 's writeMethod,and return an property 'setPayActualMoney'