public void setName(String name) { this.name = name; }
}
both of cloneBean and getProperty throw Exception.
closeBean: Exception in thread "main" java.lang.IllegalAccessException: Class org.apache.commons.beanutils.BeanUtilsBean can not access a member of class my.test.Book with modifiers "" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) at java.lang.Class.newInstance0(Class.java:344) at java.lang.Class.newInstance(Class.java:303) at org.apache.commons.beanutils.BeanUtilsBean.cloneBean(BeanUtilsBean.java:164) at org.apache.commons.beanutils.BeanUtils.cloneBean(BeanUtils.java:98) at my.test.MyCopy.main(MyCopy.java:18)
getProperty: Exception in thread "main" java.lang.NoSuchMethodException: Property 'name' has no getter method at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1127) at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686) at org.apache.commons.beanutils.BeanUtilsBean.getNestedProperty(BeanUtilsBean.java:698) at org.apache.commons.beanutils.BeanUtilsBean.getProperty(BeanUtilsBean.java:723) at org.apache.commons.beanutils.BeanUtils.getProperty(BeanUtils.java:265) at my.test.MyCopy.main(MyCopy.java:19)